mkdir elasticsearch-2.3.3/plugins
unzip /root/elasticsearch-2.3.3_all-in-one/plus/elasticsearch-head-master.zip&& mv elasticsearch-head-master/ /usr/local/tools/elasticsearch-2.3.3/plugins/head
unzip /root/elasticsearch-2.3.3_all-in-one/plus/elasticsearch-kopf-master.zip&& mv elasticsearch-kopf-master/ /usr/local/tools/elasticsearch-2.3.3/plugins/kopf
https://github.com/NLPchina/elasticsearch-sql/releases/download/2.3.3.0/elasticsearch-sql-2.3.3.0.zip
unzip elasticsearch-sql-2.3.3.0.zip
mv elasticsearch-sql-2.3.3.0/ /usr/local/tools/elasticsearch-2.3.3/plugins/sql
unzip elasticsearch-2.3.3_all-in-one/plus/elasticsearch-analysis-ik-1.9.3.zip -d /usr/local/tools/elasticsearch-2.3.3/plugins/ik
chown -R wuyuan.wuyuan /usr/local/tools/elasticsearch-2.3.3
运行 elasticsearch :
修改 elasticsearch 启动 文件 vi elasticsearch/bin/elasticsearch
ES_HEAP_SIZE=4g
MAX_OPEN_FILES=65535
进入 elasticsearch/config/
编辑配置文件 vi elasticsearch.yml
集群elasticsearch配置
cluster.name:elasticsearch_cluster
node.name:datanode1
path.data: /yschome/data/es/data
path.logs:/yschome/logs/es/logs
#当前节点ip
network.host:10.20.143.95
http.port:9200
discovery.zen.ping.unicast.hosts:
["10.20.143.95",
"10.20.143.96", "10.20.143.97"]
mkdir -p /yschome/data/es/data
mkdir -p /yschome/logs/es/logs
chown wuyuan.wuyuan -R /yschome/data/es /yschome/logs/es
chown wuyuan.wuyuan -R elasticsearch-2.3.3
以某个用户启动 elasticsearch 的命令如下:
su - wuyuan -s /bin/bash /usr/local/tools/elasticsearch-2.3.3/bin/elasticsearch &
搞好一台之后,scp到另一台 :
scp -r ./elasticsearch-2.3.3 root@10.20.101.106:/usr/local/tools/elasticsearch-2.3.3
scp -r ./elasticsearch-2.3.3 root@10.20.101.107:/usr/local/tools/elasticsearch-2.3.3
ps -ef | grep elasticsearch
重新贴出 配置文件
进去配置文件夹 :
cd /usr/local/tools/elasticsearch-2.3.3/config
datanode1配置文件:
uster.name: elasticsearch_cluster
node.name: datanode1
path.data: /yschome/data/es/data
path.logs: /yschome/logs/es/logs
network.host: 10.20.101.105
http.port: 9200
discovery.zen.ping.unicast.hosts: ["10.20.101.105", "10.20.101.106", "10.20.101.107"]
datanode2配置文件:
uster.name: elasticsearch_cluster
node.name: datanode2
path.data: /yschome/data/es/data
path.logs: /yschome/logs/es/logs
network.host: 10.20.101.106
http.port: 9200
discovery.zen.ping.unicast.hosts: ["10.20.101.105", "10.20.101.106", "10.20.101.107"]
datanode3 配置文件 :
uster.name: elasticsearch_cluster
node.name: datanode3
path.data: /yschome/data/es/data
path.logs: /yschome/logs/es/logs
network.host: 10.20.101.107
http.port: 9200
discovery.zen.ping.unicast.hosts: ["10.20.101.105", "10.20.101.106", "10.20.101.107"]
随便访问1台的 head 和 Kopf 插件页面 :
http://10.20.101.105:9200/_plugin/head/
http://10.20.101.105:9200/_plugin/kopf/
http://10.20.101.105:9200/_plugin/sql/
分词测试需要重新测试 ------->
http://10.20.101.105:9200/hotel/_analyze?analyzer=ik&text=58码农,我帮码农,我们为程序员的匠心精神服务!