我刚刚从https://www.elastic.co/downloads/elasticsearch通过使用以下命令DEB(我使用Debian 9)包安装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'.
但它没有说任何有用的东西。
在configuration文件中我只是改变了这一点:
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
我看到你的更新。 你不能使用这个configuration:
network.host: 51.15.212.76
因为你没有这个IP地址的networking接口。
例如,您可以使用eth0中的这个10.5.85.149。