服務器信息node
elasticsearch版本 1.6.0服務器
jdk版本 1.7.0_80elasticsearch
10.100.0.29 es1 10.100.0.44 es2 10.100.0.45 es3 10.100.0.46 es4 10.100.0.47 es5
cluster.name: esc1 node.name: sen1 #各節點不通 discovery.zen.minimum_master_nodes: 2 #節點數+1 再除2 discovery.zen.ping.timeout: 30s discovery.zen.ping.unicast.hosts: [10.100.0.29,10.100.0.44,10.100.0.45] index: analysis: analyzer: ik: alias: [ik_analyzer] type: org.elasticsearch.index.analysis.IkAnalyzerProvider ik_max_word: type: ik use_smart: false ik_smart: type: ik use_smart: true
啓動集羣查看集羣狀態,各節點狀態一致ide
###加入es4,5節點es5
cluster.name: esc1 node.name: sen4 discovery.zen.minimum_master_nodes: 3 #5節點修改成3 discovery.zen.ping.timeout: 30s discovery.zen.ping.unicast.hosts: [10.100.0.29, 10.100.0.44,10.100.0.45,10.100.0.46,10.100.0.47] #加入4,5節點 index: analysis: analyzer: ik: alias: [ik_analyzer] type: org.elasticsearch.index.analysis.IkAnalyzerProvider ik_max_word: type: ik use_smart: false ik_smart: type: ik use_smart: true
原1,2,3節點都已發現4,5節點,各節點狀態一致code
修改 1,2,3節點配置後依次重啓(必定要優先重啓follower,否則4,5節點報錯) 集羣擴容完成,以後能夠修改應用的配置圖片
cluster.name: esc1 node.name: sen3 discovery.zen.minimum_master_nodes: 3 #5節點最小得有3個節點在線,修改成3 discovery.zen.ping.timeout: 30s discovery.zen.ping.unicast.hosts: [10.100.0.29, 10.100.0.44,10.100.0.45,10.100.0.46,10.100.0.47] #3個節點修改成5個節點 index: analysis: analyzer: ik: alias: [ik_analyzer] type: org.elasticsearch.index.analysis.IkAnalyzerProvider ik_max_word: type: ik use_smart: false ik_smart: type: ik use_smart: true
es1收縮後的配置it
cluster.name: esc1 node.name: sen1 discovery.zen.minimum_master_nodes: 2 discovery.zen.ping.timeout: 30s discovery.zen.ping.unicast.hosts: [10.100.0.29, 10.100.0.44,10.100.0.45] index: analysis: analyzer: ik: alias: [ik_analyzer] type: org.elasticsearch.index.analysis.IkAnalyzerProvider ik_max_word: type: ik use_smart: false ik_smart: type: ik use_smart: true
####重啓1,2,3完成後集羣仍然是5節點的,此時依次關閉4,5節點ast
查看各節點狀態一致,而且狀態爲green,至此收縮完成集羣