elasticsearch集群

创建elsearch用户组及elsearch用户
groupadd elsearch
useradd elsearch -g elsearch -p elasticsearch
更改elasticsearch文件夹及内部文件的所属用户及组为elsearch:elsearch(elasticsearch为你elasticsearch的目录名称)
chown -R elsearch:elsearch  elasticsearch

=========================================
vi /etc/security/limits.conf
elsearch soft nofile 65536
elsearch hard nofile 65536

=========================================
vi elasticsearch.yml
network.host: 0.0.0.0
node.name: node-1
path.data: /usr/local/es/1/data
path.logs: /usr/local/es/1/logs
http.port: 9201
discovery.zen.ping.unicast.hosts: ["10.80.64.116", "10.80.64.128"]
discovery.zen.ping_timeout: 120s
discovery.zen.minimum_master_nodes: 2

chown -R elsearch:elsearch  /usr/local/es

=========================================
vi jvm.options
-Xms2g
-Xmx2g

=========================================
sysctl -w vm.max_map_count=262144

=========================================
启动服务
cd /usr/local/elasticsearch-0/bin/
su elsearch
./elasticsearch &

=========================================
集群状态
http://192.168.142.128:9200/_cluster/state/nodes

猜你喜欢

转载自lysunki.iteye.com/blog/2373660