elasticsearch2.2.0安装

(1)下载elasticsearch-2.2.0.tar.gz
[hadoop@h201 ~]$ tar -zxvf elasticsearch-2.0.0.tar.gz

(2)同步到其他两个节点:
[hadoop@h201 ~]$ scp -r elasticsearch-2.2.0/ hadoop@h202:/home/hadoop/
[hadoop@h201 ~]$ scp -r elasticsearch-2.2.0/ hadoop@h203:/home/hadoop/

(3)修改配置文件config/elasticsearch.yml
[hadoop@h201 elasticsearch-2.2.0]$ vi config/elasticsearch.yml

cluster.name: my-application
node.name: node-1
node.master: true
node.data: true
network.host: 192.168.121.130
http.port: 9200

discovery.zen.ping.multicast.enabled: false
discovery.zen.ping_timeout: 120s
client.transport.ping_timeout: 60s
discovery.zen.ping.unicast.hosts: ["192.168.121.132","192.168.121.131","192.168.121.130"]

[hadoop@h202 elasticsearch-2.2.0]$ vi config/elasticsearch.yml

cluster.name: my-application
node.name: node-2
node.master: false
node.data: true
network.host: 192.168.121.130
http.port: 9200

discovery.zen.ping.multicast.enabled: false
discovery.zen.ping_timeout: 120s
client.transport.ping_timeout: 60s
discovery.zen.ping.unicast.hosts: ["192.168.121.132","192.168.121.131","192.168.121.130"]

[hadoop@h203 elasticsearch-2.2.0]$ vi config/elasticsearch.yml

cluster.name: my-application
node.name: node-3
node.master: false
node.data: true
network.host: 192.168.121.130
http.port: 9200

discovery.zen.ping.multicast.enabled: false
discovery.zen.ping_timeout: 120s
client.transport.ping_timeout: 60s
discovery.zen.ping.unicast.hosts: ["192.168.121.132","192.168.121.131","192.168.121.130"]

注意:如果要配置集群需要两个节点上的elasticsearch配置的cluster.name相同,都启动可以自动组成集群,nodename随意取但是集群内的各节点不能相同

 

解释说明: 
bootstrap.memory_lock: false 
bootstrap.system_call_filter: false 一看就知道是关于内用访问的方面的配置

 

cluster.name 集群名字,同一个集群中使用相同名字,单机就随意 
node.name: node-01 节点名字 
node.master: 是否为集群的master机器 
node.data: true 是否作为数据节点 
network.host: 192.168.0.153 这个不用自然是配置ip地址的 
http.port: 9200 端口号,不配置的话默认9200 
discovery.zen.ping.unicast.hosts: [“192.168.0.153”,”192.168.0.154”,”192.168.0.155”] 这个就是配置集群的时候要用的到了,[]中填上集群中其他集群的ip的地址,如果是master的话请把所有salve的机器地址填上 
discovery.zen.minimum_master_nodes: 2 关于这个值配置多少合适的话大家去搜一下,自己权衡一下集群,这里我用了3台机器模拟集群,所以填上2。 
http.cors.enabled: true 这个参数的设置和下面一个配置就关于ip的访问策略了,如果你发现其他ip地址访问不了就有可以这参数没有配置 
http.cors.allow-origin: “*”

(4)安装es监控插件

 

./plugin install mobz/elasticsearch-head

若出现:-> Installing mobz/elasticsearch-head...
Trying https://github.com/mobz/elasticsearch-head/archive/master.zip ...
ERROR: failed to download out of all possible locations..., use --verbose to get detailed information

请使用源码安装:

 https://github.com/mobz/elasticsearch-head/archive/master.zip

unzip

在Elasticsearch的安装的plugin下创建目录head

cd /home/hadoop/elasticsearch-2.2.0/plugins

mkdir headc

 跳转到head文件夹下,将刚才解压的elasticsearch-head-master文件夹下的所有文件拷贝到head目录下,如图所示:

重新启动ElasticSearch(所有节点都启动)

./elasticsearch-2.2.0/bin/elasticsearch

使用http://192.168.121.132:9200/_plugin/head/访问浏览器,如图所示,则说明安装成功。

 

 

 

posted @ 2018-07-15 21:42  蜘蛛侠0  阅读(614)  评论(0编辑  收藏  举报