Elasticsearch

安裝 5.6.4 後 ElasticSearch 無法啟動

  • August 16, 2019

我剛剛使用以下命令通過 DEB(我使用 Debian 9)包從https://www.elastic.co/downloads/elasticsearch安裝了 ElasticSearch 5.6.4 :

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.4.deb
dpkg -i elasticsearch-5.6.4.deb
apt-get install openjdk-8-jre-headless
update-rc.d elasticsearch defaults 95 10
service elasticsearch start

但是 ElasticSearch 不會啟動,這是日誌:

● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2017-11-13 16:59:24 UTC; 13min ago
Docs: http://www.elastic.co
Process: 16503 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet -Edefault.path.logs=${LOG_DIR} -Edefault.path.data=${DATA_DIR} -Edefault.path.conf=${CONF_DIR} (code=exited, statu
Process: 16500 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
Main PID: 16503 (code=exited, status=1/FAILURE)

Nov 13 16:59:12 Mysite systemd[1]: Starting Elasticsearch...
Nov 13 16:59:12 Mysite systemd[1]: Started Elasticsearch.
Nov 13 16:59:24 Mysite systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Nov 13 16:59:24 Mysite systemd[1]: elasticsearch.service: Unit entered failed state.
Nov 13 16:59:24 Mysite systemd[1]: elasticsearch.service: Failed with result 'exit-code'.

但它並沒有說任何有用的東西。

在配置文件中我只是改變了這個:

network.host: 51.15.212.76
http.port: 9200
cluster.name: elasticsearch
node.name: "db-master"
node.master: true
node.data: true

更新:

我只是使用預設設置,它可以工作,問題在這裡:

Caused by: java.net.BindException: Cannot assign requested address

為什麼?我正在使用我的 IP 地址(我複制了它)。我不想將它綁定到本地主機,因為我希望能夠從不同的機器連接它。

ifconfig -a 的結果

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
       inet 10.5.85.149  netmask 255.255.255.254  broadcast 10.5.85.149
       inet6 fe80::207:cbff:fe0b:4d8c  prefixlen 64  scopeid 0x20<link>
       ether 00:07:cb:0b:4d:8c  txqueuelen 1000  (Ethernet)
       RX packets 18975397  bytes 14313412446 (13.3 GiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 61630671  bytes 85441277828 (79.5 GiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
       device memory 0x80000000-8001ffff

ip6_vti0: flags=128<NOARP>  mtu 1500
       unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1  (UNSPEC)
       RX packets 0  bytes 0 (0.0 B)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 0  bytes 0 (0.0 B)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ip6tnl0: flags=128<NOARP>  mtu 1452
       unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1  (UNSPEC)
       RX packets 0  bytes 0 (0.0 B)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 0  bytes 0 (0.0 B)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
       inet 127.0.0.1  netmask 255.0.0.0
       inet6 ::1  prefixlen 128  scopeid 0x10<host>
       loop  txqueuelen 1  (Local Loopback)
       RX packets 26883466  bytes 4169327225 (3.8 GiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 26883466  bytes 4169327225 (3.8 GiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

sit0: flags=128<NOARP>  mtu 1480
       sit  txqueuelen 1  (IPv6-in-IPv4)
       RX packets 0  bytes 0 (0.0 B)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 0  bytes 0 (0.0 B)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

問題是您51.15.212.76的伺服器上沒有。您的提供商可能會映射51.15.212.76->10.5.85.149

所以試試這個

network.host: 10.5.85.149

或者更好地綁定到所有介面

network.host: 0.0.0.0

我看到了你的更新。您不能使用此配置:

network.host: 51.15.212.76

因為您沒有具有此 IP 地址的網路介面。

例如,您可以使用來自 eth0 的 10.5.85.149。

引用自:https://serverfault.com/questions/883269