Elasticsearch(6.2.2) 群集搭建

OS层面的系统参数修改

sudo yum install java-1.8.0-openjdk.x86_64

sysctl -w vm.max_map_count=262144

vim /etc/security/limits.conf

*        hard    nofile          65536

*        soft    nofile          65536


创建ES专用用户

groupadd es

useradd -g es es 


创建ES专用目录

mkdir -p /export/elasticsearch/data

mkdir -p /export/elasticsearch/logs

chown -R es:es /export/elasticsearch


下载安装源

cd /opt

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.2.tar.gz

tar -zxvf elasticsearch-6.2.2.tar.gz

chown -R es:es /opt/elasticsearch-6.2.2


ES配置文件的参数修改

vim /opt/elasticsearch-6.2.2/config/elasticsearch.yml

cluster.name: xxx

node.name: xxx

network.host: xxx (每个节点根据自己的IP或hostname配置)

http.por: xxx

transport.tcp.port: xxx

discovery.zen.ping.unicast.hosts: ["xxx", "xxx"]  (将各个节点的IP或者hostname都加入进来)

path.data: xxx

path.logs: xxx

discovery.zen.minimum_master_nodes: (N/2 + 1)  (N为主节点个数)


启动ES(每个节点相同操作)

su - es

cd /opt/elasticsearch-6.2.2/

bin/elasticsearch &

你可能感兴趣的:(Elasticsearch(6.2.2) 群集搭建)