首页 > IT职业 > IT职场 > Linux 搭建 ElasticSearch5.x
# java -version

# service iptables status # service iptables stop # chkconfig iptables off # yum install -y wget vim # vim /etc/selinux/config //SELINUX=enforcing更改为SELINUX=disabled # reboot
# cd /usr/local/ # wget # tar -zxvf elasticsearch-5.5.2.tar.gz # cd elasticsearch-5.5.2/ # vim config/elasticsearch.yml //添加如下配置
# 配置es的集群名称, es会自动发现在同一网段下的es,如果在同一网段下有多个集群,就可以用这个属性来区分不同的集群 cluster.name: elasticsearch # 节点名称 node.name: "es_client" bootstrap.memory_lock: false bootstrap.system_call_filter: false network.host: 0.0.0.0

# groupadd elsearch # useradd elsearch -g elsearch -p elasticsearch # chown -R elsearch:elsearch /usr/local/elasticsearch-5.5.2 //更改用户权限 # su elsearch # ./bin/elasticsearch

切换成root用户执行以下命令
# su root # vim /etc/security/limits.conf //添加如下内容: * soft nofile 65536 * hard nofile 131072 * soft nproc 2048 * hard nproc 4096

# vim /etc/security/limits.d/90-nproc.conf //修改如下内容: * soft nproc 1024 -----修改为 * soft nproc 2048

# vim /etc/sysctl.conf 添加下面配置: vm.max_map_count=655360 并执行命令: # sysctl -p
# su elsearch # ./bin/elasticsearch # ./bin/elasticsearch -d //后台运行
作者:試毅_思伟
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2435/viewspace-2822735/ ,如需转载,请注明出处,否则将追究法律责任。