centos上es安装

版权声明:本文为博主原创文章,转载时请在文章最前方附上本文地址。 https://blog.csdn.net/qq_35033270/article/details/88559016

1 解压
安装ES,将es-5.4.3.tar.gz文件拷贝到/home/server下,解压:
unzip elasticsearch-5.4.3.zip

2 部署启动ES
2.1修改/etc/security/limits.conf: 添加以下内容
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
root soft nofile 65536:
root hard nofile 65536

2.2修改 /etc/sysctl.conf:添加以下内容。
vm.max_map_count=655360
fs.file-max=655362
添加后执行
# sysctl -p //使配置生效。

2.3 建立用户elastic:
[root@sx-01] # groupadd elastic
[root@sx-01] # useradd elastic -g elastic -p elasticsearch
[root@sx-01] # cd /home/server
[root@sx-01] # chown -R elastic elasticsearch-5.4.3/
[root@sx-01] # su elastic
[elastic@sx-01]chmod 744 -R elasticsearch-5.4.3/

2.4 elasticsearch配置及启动:
系统配置修改完成后,修改elasticsearch-5.4.3配置
[root@rlsb config]# cd /home/server/elasticsearch-5.4.3/config
[root@rlsb config]# vim elasticsearch.yml

cluster.name: elastic-x
network.host: 本机ip
http.port: 9209
transport.tcp.port: 9309
http.cors.enabled: true
http.cors.allow-origin: ""
action.auto_create_index: .security,.monitoring
,.watches,.triggered_watches,.watcher-history*
如图所示:

2.5 ES启动
[root@sx-01]#cd /home/server/elasticsearch-5.4.3/bin
[root@sx-01 bin]# su elastic
$ ./elasticsearch -d

3 启动验证ES
访问es地址http://{ip: 9209},出现类似下面的json数据,表示es启动正常。注:ip和端口可通过运行es状态命令查看

猜你喜欢

转载自blog.csdn.net/qq_35033270/article/details/88559016