当前位置: 首页 > 知识库问答 >
问题:

elasticsearch无法在ubuntu 15.10中启动服务

宋奇希
2023-03-14
/etc/init.d/elasticsearch restart
root@sid-laptop:/etc/init.d# /etc/init.d/elasticsearch restart
+ id -u
+ [ 0 -ne 0 ]
+ . /lib/lsb/init-functions
+ run-parts --lsbsysinit --list /lib/lsb/init-functions.d
+ [ -r /lib/lsb/init-functions.d/01-upstart-lsb ]
+ . /lib/lsb/init-functions.d/01-upstart-lsb
+ unset UPSTART_SESSION
+ _RC_SCRIPT=/etc/init.d/elasticsearch
+ [ -r /etc/init//etc/init.d/elasticsearch.conf ]
+ _UPSTART_JOB=elasticsearch
+ [ -r /etc/init/elasticsearch.conf ]
+ [ -r /lib/lsb/init-functions.d/20-left-info-blocks ]
+ . /lib/lsb/init-functions.d/20-left-info-blocks
+ [ -r /lib/lsb/init-functions.d/40-systemd ]
+ . /lib/lsb/init-functions.d/40-systemd
+ _use_systemctl=0
+ [ -d /run/systemd/system ]
+ [ -n  ]
+ [ 6714 -ne 1 ]
+ [ -z  ]
+ [ -z  ]
+ readlink -f /etc/init.d/elasticsearch
+ _use_systemctl=1
+ prog=elasticsearch
+ service=elasticsearch.service
+ systemctl -p CanReload show elasticsearch.service
+ [ CanReload=no = CanReload=no ]
+ [ restart = reload ]
+ [ 1 = 1 ]
+ set +e
+ set +u
+ [ xrestart = xstart -o xrestart = xstop -o xrestart = xrestart -o xrestart = xreload -o xrestart = xforce-reload -o xrestart = xstatus ]
+ systemctl_redirect /etc/init.d/elasticsearch restart
+ local s
+ local rc
+ local prog=elasticsearch
+ local command=restart
+ s=Restarting elasticsearch (via systemctl)
+ service=elasticsearch.service
+ systemctl -p LoadState show elasticsearch.service
+ state=LoadState=loaded
+ [ LoadState=loaded = LoadState=masked ]
+ systemctl is-system-running
+ OUT=running
+ [ restart = status ]
+ log_daemon_msg Restarting elasticsearch (via systemctl) elasticsearch.service
+ [ -z Restarting elasticsearch (via systemctl) ]
+ log_daemon_msg_pre Restarting elasticsearch (via systemctl) elasticsearch.service
+ log_use_fancy_output
+ TPUT=/usr/bin/tput
+ EXPR=/usr/bin/expr
+ [ -t 1 ]
+ [ xxterm-256color != x ]
+ [ xxterm-256color != xdumb ]
+ [ -x /usr/bin/tput ]
+ [ -x /usr/bin/expr ]
+ /usr/bin/tput hpa 60
+ /usr/bin/tput setaf 1
+ [ -z ]
+ FANCYTTY=1
+ true
+ /bin/echo -n [....] 
[....] + [ -z elasticsearch.service ]
+ echo -n Restarting elasticsearch (via systemctl): elasticsearch.service
Restarting elasticsearch (via systemctl): elasticsearch.service+ log_daemon_msg_post Restarting elasticsearch (via systemctl) elasticsearch.service
+ :
+ /bin/systemctl restart elasticsearch.service
Warning: elasticsearch.service changed on disk. Run 'systemctl daemon-reload' to reload units.
+ rc=0
+ [ restart = status ]
+ log_end_msg 0
+ [ -z 0 ]
+ local retval
+ retval=0
+ log_end_msg_pre 0
+ log_use_fancy_output
+ TPUT=/usr/bin/tput
+ EXPR=/usr/bin/expr
+ [ -t 1 ]
+ [ xxterm-256color != x ]
+ [ xxterm-256color != xdumb ]
+ [ -x /usr/bin/tput ]
+ [ -x /usr/bin/expr ]
+ /usr/bin/tput hpa 60
+ /usr/bin/tput setaf 1
+ [ -z 1 ]
+ true
+ true
+ /usr/bin/tput setaf 1
+ RED=
+ /usr/bin/tput setaf 2
+ GREEN=
+ /usr/bin/tput setaf 3
+ YELLOW=
+ /usr/bin/tput op
+ NORMAL=
+ /usr/bin/tput civis
+ /usr/bin/tput sc
+ /usr/bin/tput hpa 0
+ [ 0 -eq 0 ]
+ /bin/echo -ne [ ok 
[ ok + /usr/bin/tput rc
+ /usr/bin/tput cnorm
+ log_use_fancy_output
+ TPUT=/usr/bin/tput
+ EXPR=/usr/bin/expr
+ [ -t 1 ]
+ [ xxterm-256color != x ]
+ [ xxterm-256color != xdumb ]
+ [ -x /usr/bin/tput ]
+ [ -x /usr/bin/expr ]
+ /usr/bin/tput hpa 60
+ /usr/bin/tput setaf 1
+ [ -z 1 ]
+ true
+ true
+ /usr/bin/tput setaf 1
+ RED=
+ /usr/bin/tput setaf 3
+ YELLOW=
+ /usr/bin/tput op
+ NORMAL=
+ [ 0 -eq 0 ]
+ echo .
.
+ log_end_msg_post 0
+ :
+ return 0
+ return 0
+ exit 0

试了一整天,还是想不出来。
“ps-a”也没有显示弹性搜索过程。请帮忙。

更多信息:
我试过了

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

    sid@sid-laptop:/etc/init.d$ 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
    [sudo] password for sid: 
    sid@sid-laptop:/etc/init.d$ {1.6.2}: pid Failed ...
    - FileNotFoundException[/var/run/elasticsearch.pid (Permission denied)]
    java.io.FileNotFoundException: /var/run/elasticsearch.pid (Permission denied)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.(FileOutputStream.java:213)
        at java.io.FileOutputStream.(FileOutputStream.java:162)
        at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:194)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32

共有1个答案

澹台阳秋
2023-03-14

Ubuntu不允许管理员以外的其他用户写到/var/run,这是有充分理由的。

您是否注意到elasticsearch是由elasticsearch在安装时创建的“elasticsearch”用户启动的:

SUDO-U弹性搜索....

sudo mkdir /var/run/elasticsearch/
sudo chown elasticsearch:elasticsearch /var/run/elasticsearch 
sudo vim /etc/init.d/elasticsearch 
PID_FILE=/var/run/elasticsearch/$NAME.pid
 类似资料:
  • 问题内容: 我最近将计算机从Ubuntu升级到。我面临使用服务即服务的问题。我安装 使用: 现在命令显示了这个结果: 尽管我的机器上安装了Java,但是我可以使用此命令启动服务器。 我有点卡在这里。任何帮助将不胜感激。 编辑 设置后根的错误: 问题答案: 我找到了解决此问题的方法。解决方案来自该讨论线程- 无法在Elastic网站上使用Ubuntu 16.04启动Elasticsearch 。 似

  • 问题内容: 我已经阅读了这里提供的三种解决方案。跟着这三个,但是它不起作用。每当我尝试将elasticsearch作为服务运行时: 它总是给我: 现在,当我尝试查找错误日志(/ var / log / elasticsearch)时,它永远不会出现。任何想法? 问题答案: 确保您拥有JDK并指定了和var。 以下代码段对我有用: 随时可以键入以下内容,以查看程序的作用: 最后,您可以使用pid杀死

  • 问题内容: 我一直在尝试 在Ubuntu 16.04上 使用 Docker(1.10), 但安装失败,因为 Docker Service无法启动 。我已经尝试通过 docker.io和docker -engine apt软件包安装 docker ,但是它不起作用。 我的 主机信息 是: 这里是 : 这是 这是 ./check- config.sh 输出: 如果有人可以帮助我,我将非常感激 问题答案

  • 问题内容: 用Brew安装后,我无法在Mac上启动ElasticSearch 5.6服务器。得到这个错误: 由于它不是ElasticSearch的最新版本,因此我想它安装了一些不兼容的软件包版本,尽管不确定到底是哪个软件包。 任何人都可以帮助使其正常工作吗? 问题答案: 我只是遇到了同样的问题,而重新生成密钥库为我解决了这个问题。这是我采取的步骤: 备份现有的密钥库: 生成新的密钥库:

  • 我在试着让我的弹性搜索下沉并运行。然而,我得到了以下错误,并正在耗尽如何修复它的想法。任何帮助都很感激。以下是错误: 我运行的是CDH 5.3和elasticsearch 1.4.2