gpt4 book ai didi

ubuntu - 为什么 elasticsearch 不能在 Ubuntu 14.04 上运行?

转载 作者:行者123 更新时间:2023-11-29 02:43:02 25 4
gpt4 key购买 nike

我正在尝试确定 elasticsearch 实例是否正在运行,但它似乎没有:

ubuntu@ubuntu:~$ sudo service elasticsearch status
* elasticsearch is not running
ubuntu@ubuntu:~$ sudo service elasticsearch start
* Starting Elasticsearch Server [ OK ]
ubuntu@ubuntu:~$ sudo service elasticsearch status
* elasticsearch is not running
and

ubuntu@ubuntu:~$ sudo /etc/init.d/elasticsearch status
* elasticsearch is not running
ubuntu@ubuntu:~$ sudo /etc/init.d/elasticsearch start
* Starting Elasticsearch Server [ OK ]
ubuntu@ubuntu:~$ sudo /etc/init.d/elasticsearch status
* elasticsearch is not running
ubuntu@ubuntu:/etc/elasticsearch# sudo service elasticsearch restart
* Stopping Elasticsearch Server [ OK ]
* Starting Elasticsearch Server [ OK ]
ubuntu@ubuntu:/etc/elasticsearch# sudo service elasticsearch status
* elasticsearch is not running

ubuntu@ubuntu:~$ curl -XGET localhost:9200/_nodes/_all/process?pretty
curl: (7) Failed to connect to localhost port 9200: Connection refused

ubuntu@ubuntu:/etc/elasticsearch$ sudo netstat -nlp
tcp6 0 0 :::9300 :::* LISTEN 4413/java

UPD

我的 elasticsearch.log:

[2014-12-03 00:00:02,161][INFO ][cluster.metadata         ] [Zero] [logstash-2014.12.03] creating index, cause [auto(bulk api)], shards [5]/[1], mappings [_default_]
[2014-12-03 00:00:02,617][INFO ][cluster.metadata ] [Zero] [logstash-2014.12.03] update_mapping [logs] (dynamic)
[2014-12-03 00:00:12,737][INFO ][cluster.metadata ] [Zero] [logstash-2014.12.03] update_mapping [logs] (dynamic)
[2014-12-03 00:00:17,587][INFO ][cluster.metadata ] [Zero] [logstash-2014.12.03] update_mapping [logs] (dynamic)
[2014-12-03 00:00:18,842][INFO ][cluster.metadata ] [Zero] [logstash-2014.12.03] update_mapping [logs] (dynamic)
[2014-12-03 01:00:01,430][INFO ][cluster.metadata ] [Zero] [logstash-2014.11.25] deleting index
[2014-12-03 09:46:57,461][INFO ][cluster.metadata ] [Zero] [logstash-2014.12.03] update_mapping [logs] (dynamic)

最佳答案

Elasticsearch 服务初始化脚本在启动失败时不会在控制台或日志文件上打印任何错误信息,而是荒谬地显示 [OK]

您必须使用与初始化脚本相同的用户和相同的参数手动运行 elaticsearch,以检查出现了什么问题。错误消息将打印在控制台上。

在我安装了 elasticsearch-1.4.1.deb 的 Ubuntu 14.10 上,没有更改任何路径,运行 elastisearch 的命令是:

sudo -u elasticsearch /usr/share/elasticsearch/bin/elasticsearch -d -p /var/run/elasticsearch.pid --default.config=/etc/elasticsearch/elasticsearch.yml --default.path.home=/usr/share/elasticsearch --default.path.logs=/var/log/elasticsearch --default.path.data=/var/lib/elasticsearch --default.path.work=/tmp/elasticsearch --default.path.conf=/etc/elasticsearch

我只是在 /etc/init.d/elasticsearch 中添加了一行来打印上面的命令:

# Start Daemon
log_daemon_msg "sudo -u $ES_USER $DAEMON $DAEMON_OPTS" # <-- Add this line
start-stop-daemon --start -b --user "$ES_USER" -c "$ES_USER" --pidfile "$PID_FILE" --exec $DAEMON -- $DAEMON_OPTS
log_end_msg $?

关于ubuntu - 为什么 elasticsearch 不能在 Ubuntu 14.04 上运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27273998/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com