elasticsearch集群的部署
1.部署4个节点的elasticsearch
10.41.2.84 es2
10.41.2.85 es3
10.41.2.86 es4
2.集群配置
2.1配置10.41.2.84上的es
vi /usr/local/search/elasticsearch-1.3.1/config/elasticsearch.yml
cluster.name: escluster #集群的名称,同一个集群该值必须设置成相同的
node.name: "es2" #该节点的名字
node.master: true #该节点有机会成为master节点
node.data: true #该节点可以存储数据
node.rack: rack2 #该节点所属的机架
index.number_of_shards: 5 #shard的数目
index.number_of_replicas: 3 #数据副本的数目
network.bind_host: 0.0.0.0 #设置绑定的IP地址,可以是IPV4或者IPV6
network.publish_host: 10.41.2.84 #设置其他节点与该节点交互的IP地址
network.host: 10.41.2.84 #该参数用于同时设置bind_host和publish_host
transport.tcp.port: 9300 #设置节点之间交互的端口号
transport.tcp.compress: true #设置是否压缩tcp上交互传输的数据
http.port: 9200 #设置对外服务的http 端口号
http.max_content_length: 100mb #设置http内容的最大大小
http.enabled: true #是否开启http服务对外提供服务
discovery.zen.minimum_master_nodes: 2 #设置这个参数来保证集群中的节点可以知道其它N个有master资格的节点。默认为1,对于大的集群来说,可以设置大一点的值(2-4)
discovery.zen.ping.timeout: 120s #设置集群中自动发现其他节点时ping连接的超时时间
discovery.zen.ping.multicast.enabled: true #设置是否打开多播发现节点
discovery.zen.ping.unicast.hosts: ["10.41.2.84:9300","10.41.2.85:9300", "10.41.2.86:9300"] #设置集群中的Master节点的初始列表,可以通过这些节点来自动发现其他新加入集群的节点
2.2配置10.41.2.85上的es
vi /usr/local/search/elasticsearch-1.3.1/config/elasticsearch.yml
cluster.name: escluster #集群的名称,同一个集群该值必须设置成相同的
node.name: "es3" #该节点的名字
node.master: true #该节点有机会成为master节点
node.data: true #该节点可以存储数据
node.rack: rack3 #该节点所属的机架
index.number_of_shards: 5 #shard的数目
index.number_of_replicas: 3 #数据副本的数目
network.bind_host: 0.0.0.0 #设置绑定的IP地址,可以是IPV4或者IPV6
network.publish_host: 10.41.2.85 #设置其他节点与该节点交互的IP地址
network.host: 10.41.2.85 #该参数用于同时设置bind_host和publish_host
transport.tcp.port: 9300 #设置节点之间交互的端口号
transport.tcp.compress: true #设置是否压缩tcp上交互传输的数据
http.port: 9200 #设置对外服务的http 端口号
http.max_content_length: 100mb #设置http内容的最大大小
http.enabled: true #是否开启http服务对