ElasticSearch学习笔记-集群安装部署

集群版本:elasticsearch-2.4.6.tar.gz

集群节点:

centos.master  192.168.10.10

centos.slave1   192.168.10.11

centos.slave2   192.168.10.12

配置文件 elasticsearch.yml:

cluster.name: elasticsearch
node.name: master
node.master: true
node.data: true
path.data: /home/hadoop/software/elasticsearch-2.4.6/data
path.logs: /home/hadoop/software/elasticsearch-2.4.6/logs
bootstrap.mlockall: true
network.host: 192.168.10.10
http.port: 9200
transport.tcp.port: 9300
transport.tcp.compress: true
discovery.zen.ping.unicast.hosts: ["192.168.10.10", "192.168.10.11", "192.168.10.12"]
discovery.zen.minimum_master_nodes: 1
index.refresh_interval: -1
indices.memory.index_buffer_size:  20%
indices.reovery.max_bytes_per_sec: 10gb
index.merge.policy.max_merged_segment: 10gb
index.merge.scheduler.max_thread_count: 3
index.merge.scheduler.max_merge_count: 6
index.translog.flush_threshold_ops: 50000
index.translog.flush_threshold_size: 5gb
index.search.slowlog.level: TRACE
index.search.slowlog.threshold.query.warn: 10s
index.search.slowlog.threshold.query.info: 5s
index.search.slowlog.threshold.query.debug: 2s
index.search.slowlog.threshold.query.trace: 500ms
index.search.slowlog.threshold.fetch.warn: 1s
index.search.slowlog.threshold.fetch.info: 800ms
index.search.slowlog.threshold.fetch.debug: 500ms
index.search.slowlog.threshold.fetch.trace: 200ms
index.indexing.slowlog.threshold.index.warn: 10s
index.indexing.slowlog.threshold.index.info: 5s
index.indexing.slowlog.threshold.index.debug: 2s
index.indexing.slowlog.threshold.index.trace: 500m
security.manager.enabled: false

 

cluster.name: elasticsearch
node.name: slave1
node.master: false
node.data: true
path.data: /home/hadoop/software/elasticsearch-2.4.6/data
path.logs: /home/hadoop/software/elasticsearch-2.4.6/logs
bootstrap.mlockall: true
network.host: 192.168.10.11
http.port: 9200
transport.tcp.port: 9300
transport.tcp.compress: true
discovery.zen.ping.unicast.hosts: ["192.168.10.10", "192.168.10.11", "192.168.10.12"]
discovery.zen.minimum_master_nodes: 1
index.refresh_interval: -1
indices.memory.index_buffer_size:  20%
indices.reovery.max_bytes_per_sec: 10gb
index.merge.policy.max_merged_segment: 10gb
index.merge.scheduler.max_thread_count: 3
index.merge.scheduler.max_merge_count: 6
index.translog.flush_threshold_ops: 50000
index.translog.flush_threshold_size: 5gb
index.search.slowlog.level: TRACE
index.search.slowlog.threshold.query.warn: 10s
index.search.slowlog.threshold.query.info: 5s
index.search.slowlog.threshold.query.debug: 2s
index.search.slowlog.threshold.query.trace: 500ms
index.search.slowlog.threshold.fetch.warn: 1s
index.search.slowlog.threshold.fetch.info: 800ms
index.search.slowlog.threshold.fetch.debug: 500ms
index.search.slowlog.threshold.fetch.trace: 200ms
index.indexing.slowlog.threshold.index.warn: 10s
index.indexing.slowlog.threshold.index.info: 5s
index.indexing.slowlog.threshold.index.debug: 2s
index.indexing.slowlog.threshold.index.trace: 500m
security.manager.enabled: false

 

cluster.name: elasticsearch
node.name: slave2
node.master: false
node.data: true
path.data: /home/hadoop/software/elasticsearch-2.4.6/data
path.logs: /home/hadoop/software/elasticsearch-2.4.6/logs
bootstrap.mlockall: true
network.host: 192.168.10.12
http.port: 9200
transport.tcp.port: 9300
transport.tcp.compress: true
discovery.zen.ping.unicast.hosts: ["192.168.10.10", "192.168.10.11", "192.168.10.12"]
discovery.zen.minimum_master_nodes: 1
index.refresh_interval: -1
indices.memory.index_buffer_size:  20%
indices.reovery.max_bytes_per_sec: 10gb
index.merge.policy.max_merged_segment: 10gb
index.merge.scheduler.max_thread_count: 3
index.merge.scheduler.max_merge_count: 6
index.translog.flush_threshold_ops: 50000
index.translog.flush_threshold_size: 5gb
index.search.slowlog.level: TRACE
index.search.slowlog.threshold.query.warn: 10s
index.search.slowlog.threshold.query.info: 5s
index.search.slowlog.threshold.query.debug: 2s
index.search.slowlog.threshold.query.trace: 500ms
index.search.slowlog.threshold.fetch.warn: 1s
index.search.slowlog.threshold.fetch.info: 800ms
index.search.slowlog.threshold.fetch.debug: 500ms
index.search.slowlog.threshold.fetch.trace: 200ms
index.indexing.slowlog.threshold.index.warn: 10s
index.indexing.slowlog.threshold.index.info: 5s
index.indexing.slowlog.threshold.index.debug: 2s
index.indexing.slowlog.threshold.index.trace: 500m
security.manager.enabled: false

安装插件

[hadoop@centos elasticsearch-2.4.6]$ bin/plugin install mobz/elasticsearch-head

浏览器访问网址 http://centos.master:9200/_plugin/head/ 可以看到集群相关信息

 

[hadoop@centos elasticsearch-2.4.6]$ bin/plugin install lmenezes/elasticsearch-kopf

 

浏览器访问网址 http://centos.master:9200/_plugin/kopf/ 可以看到集群相关信息

 

[hadoop@centos elasticsearch-2.4.6]$ bin/plugin install delete-by-query

可以清除查询到索引类型数据

 

简繁体转换插件

项目地址:https://github.com/medcl/elasticsearch-analysis-stconvert 

mvn clean -X -U -Dmaven.test.skip=true package 编译打包

拷贝release下面的zip并解压到你的es plugins目录下面,重启ES即可

 

拼音插件

项目地址:https://github.com/medcl/elasticsearch-analysis-pinyin.git

 

IK分词插件

项目地址:https://github.com/medcl/elasticsearch-analysis-ik

 

启动各个节点的ElasticSearch服务

[hadoop@centos elasticsearch-2.4.6]$ bin/elasticsearch -d

 

单节点多个ES实例安装部署

在config目录下新建目录instance00、instance01、instance02,拷贝elasticsearch.yml、logging.yml文件至这三个目录下。修改配置文件如下:

cluster.name: elasticsearch
node.name: node-00
path.data: /home/hadoop/software/elasticsearch-2.4.6/data/00
path.logs: /home/hadoop/software/elasticsearch-2.4.6/logs/00
bootstrap.mlockall: true
network.host: 192.168.10.20
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["192.168.10.20:9300"]

 

cluster.name: elasticsearch
node.name: node-01
path.data: /home/hadoop/software/elasticsearch-2.4.6/data/01
path.logs: /home/hadoop/software/elasticsearch-2.4.6/logs/01
bootstrap.mlockall: true
network.host: 192.168.10.20
http.port: 9201
transport.tcp.port: 9301
discovery.zen.ping.unicast.hosts: ["192.168.10.20:9300"]

 

cluster.name: elasticsearch
node.name: node-02
path.data: /home/hadoop/software/elasticsearch-2.4.6/data/02
path.logs: /home/hadoop/software/elasticsearch-2.4.6/logs/02
bootstrap.mlockall: true
network.host: 192.168.10.20
http.port: 9202
transport.tcp.port: 9302
discovery.zen.ping.unicast.hosts: ["192.168.10.20:9300"]


启动节点服务

$ bin/elasticsearch -d -Des.path.conf=config/instance00 -p /tmp/elasticsearch_00.pid

$ bin/elasticsearch -d -Des.path.conf=config/instance01 -p /tmp/elasticsearch_01.pid

$ bin/elasticsearch -d -Des.path.conf=config/instance02 -p /tmp/elasticsearch_02.pid

 

 

你可能感兴趣的:(ElasticSearch,ElasticSearch)