Elasticsearch6 最新版本(Centos7)安装与遇到问题总结

原创收藏0194
用户头像
宇宙超级无敌手VIP12018-09-08 09:55:12
悬赏:0网币

1.从官网下载rpm包

rpm -ivh elasticsearch-2.3.5.rpm 

systemctl daemon-reloa

2.启动并查看安装状态

开启服务 
systemctl enable elasticsearch.service
启动服务
systemctl start elasticsearch
查看状态
systemctl status elasticsearch

启动elasticsearch 报错误 no java in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin)

解决办法指定Java home 路径

vi /etc/sysconfig/elasticsearch

JAVA_HOME=路径

sudo systemctl restart elasticsearch.service3

sudo systemctl status elasticsearch.service


又启动失败,查看错误  cat /var/log/elasticsearch/elasticsearch.log

[Failed to bind to [9300-9400]]; nested: ChannelException[Failed to bind to: localhost/35.127.0.0:9400]

解决办法:

IP绑定改成如下或者127.0.0.1

network.host: 0.0.0.0


3,  curl -XGET "127.0.0.1:9200"

4,配置端口及IP绑定

vi /etc/elasticsearch/elasticsearch.yml

找到如下部分删除前面的# 并修改相应的IP地址与端口即可

# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
#http模式连接只用
http.port: 9200

#程序连接只用 spring boot连接的时使用此端口 别搞混了 
transport.tcp.port: 9300
#
# For more information, consult the network module documentation.



5, 目录说明

Elasticsearch home directory
ES_HOME=/usr/share/elasticsearch
Elasticsearch Java path
JAVA_HOME=/opt/jdk1.8.0_141
Elasticsearch configuration directory
CONF_DIR=/etc/elasticsearch
Elasticsearch data directory
DATA_DIR=/var/lib/elasticsearch
Elasticsearch logs directory
LOG_DIR=/var/log/elasticsearch
Elasticsearch PID directory
PID_DIR=/var/run/elasticsearch
Additional Java OPTS
ES_JAVA_OPTS="${LOG_DIR} -Edefault.path.data=${DATA_DIR} -Edefault.path.conf=${CONF_DIR}"
编辑:2018-09-08 09:55:12
评论
  • 消灭零回复
精彩推荐
没有相关数据
这里可作为广告区域
layui

微信扫码关注MGL公众号