-
安装ik分词器(必须安装maven)
-
上传相应jar包
-
解压到相应目录
-
unzip elasticsearch-analysis-ik-master.zip(zip包)
-
cp -r elasticsearch-analysis-ik-master /export/servers/
-
-
cd elasticsearch-analysis-ik-master/
-
mvn package -Pdist,native -DskipTests -Dtar
-
cd /export/servers/elasticsearch-analysis-ik-master/target/releases
-
unzip elasticsearch-analysis-ik-6.0.0.zip
-
解压后查看文件目录,发现elasticsearch文件夹才是我们想要的
-
cp -r elasticsearch /export/servers/elasticsearch/plugins/
-
vi plugin-descriptor.properties
-
71行(71+shift+g) elasticsearch.version=6.0.0 修改为 elasticsearch.version=6.1.1
-
-
重新启动es
-
bin/elasticsearch
-
-
-
-
搭建集群
-
首先将elasticsearch文件夹以及环境变量拷贝到其他两台机器
-
scp -r elasticsearch root@node-002:/export/servers/
-
scp -r elasticsearch root@node-003:/export/servers/
-
scp -r /etc/profile root@node-002:/etc/profile
-
scp -r /etc/profile root@node-003:/etc/profile
-
-
修改node-001配置信息
-
cd /export/servers/elasticsearch/config
-
vim elasticsearch.yml
-
添加 node.master: true node.data: true
-
-
-
修改node-002配置信息
-
cd /export/servers/elasticsearch/config
-
vim elasticsearch.yml
-
修改 node.name: node-002 network.host: 192.168.229.132 添加 node.master: false node.data: true
-
-
-
修改node-003配置信息
-
cd /export/servers/elasticsearch/config
-
vim elasticsearch.yml
-
修改 node.name: node-003 network.host: 192.168.229.133 添加 node.master: false node.data: true
-
-
-
node-002,node-003启动之前设置
-
node-002,node-003分别新增用户es
-
useradd es
-
-
把elasticsearch软件赋给es组es用户
-
chown -R es:es /export/servers/elasticsearch/
-
-
分别在data目录下创建文件夹es
-
并且在es文件夹下面创建data和logs两个文件夹
-
mkdir es cd es mkdir data logs
-
-
-
分别给elasticsearch以及刚刚创建的文件夹增加es用户权限
-
chown -R es:es /export/data/es chown -R es:es /export/data/es/data chown -R es:es /export/data/es/logs
-
-
分发node-001上面的配置文件到node-002,node-003
-
scp -r /etc/security/limits.conf root@node-002:/etc/security/ scp -r /etc/security/limits.conf root@node-003:/etc/security/ scp -r /etc/security/limits.d/90-nproc.conf root@node-002:/etc/security/limits.d scp -r /etc/security/limits.d/90-nproc.conf root@node-003:/etc/security/limits.d scp -r /etc/sysctl.conf root@node-002:/etc/ scp -r /etc/sysctl.conf root@node-003:/etc/
-
执行命令
-
sudo sysctl -p
-
-
重新启动node-002,node-003使得配置文件重新加载执行
-
切换到es用户进行启动elasticsearch
-
首先启动nide-001
-
其次启动其他两台机器并且观察node-001的变化
-
-
-
-
转载于:https://www.cnblogs.com/lxyuuuuu/p/9619689.html