基本架构
#h15 kibala +marvel+elasticsearch
#h16 elasticsearch+marvel
#h17 elasticsearch+marvel
1. 准备文件:elasticsearch-2.2.0.tar.gz、kibana-4.4.1-linux-x64.tar.gz、文件夹插件选用(license、marvel-agent)
2. 上传elasticsearch-2.2.0.tar.gz文件到h15的/opt/com/soft/下解压
3. 进入目录:/opt/com/soft/elasticsearch-2.2.0/config下,修改config/elasticsearch.yml文件(注意背景空格!!)
a) Cluster.name要一样------------》 cluster.name: myElasticSearch
b) Node.name要不一样----------》 node.name: node1
c) Network.host本机域名ip ------------------》network.host: 192.168.142.115
d) 防脑裂配置
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping_timeout: 120s
client.transport.ping_timeout: 60s
discovery.zen.ping.unicast.hosts: ["192.168.142.115","192.168.142.116", "192.168.142.117"]
4. 群发到其他节点,修改相应配置,node.name和network.host
# scp -r /opt/com/soft/elasticsearch-2.2.0/ root@h16:/opt/com/soft/
# scp -r /opt/com/soft/elasticsearch-2.2.0/ root@h17:/opt/com/soft/
修改:h16和h17上的/opt/com/soft/elasticsearch-2.2.0/config/elasticsearch.yml文件
即内容node.name和network.host
#network.host: 192.168.142.116
#node.name: node2
#network.host: 192.168.142.117
#node.name: node3
5. 只需要在一台机器上hh15上安装kibana,修改一个elasticsearch的url就可以了
解压到/opt/com/soft目录下,修改其配置文件vi config/kibana.yml的elasticsearch.url属性即可
#elasticsearch.url: "http://192.168.142.115:9200"
6. 安装marvel插件(每台elasticsearch、kibana(只需要在一台机器好h15即可)上都要安装),才能看集群状态
第一种方法:手动下载(不推荐)
Step 1: Install Marvel into Elasticsearch:
bin/plugin install license
bin/plugin install marvel-agent
Step 2: Install Marvel into Kibana:
bin/kibana plugin --install elasticsearch/marvel/2.2.0
Step 3: Start Elasticsearch and Kibana:
bin/elasticsearch
bin/kibana
Step 4: Navigate to http://localhost:5601/app/marvel
推荐使用第二种方法:
1\直接复制插件文件(license和marvel-agent)到
/opt/com/soft/elasticsearch-2.2.0/plugins目录下即可
2\安装mavel到kibana里面:bin/kibana plugin --install elasticsearch/marvel/2.2.0
然后群发plugins到h16和h17上
注意:如果没有plugins目录,则创建一个目录即可
7. 在h15新创建普通用户,
#groupadd groupname
#useradd username -g groupname
8. 将所有目录和文件的权限修改为这个新普通用户的权限,
#chown -R username:groupname elasticsearch的目录
如:#chown -R username:groupname /opt/com/soft/elasticsearch-2.2.0/
9. 切换到普通用户启动elasticsearch。通过bin/elasticsearch启动(其他2台机器也需要重复7\8,然后启动)
#su username
10. 启动kibana不用在非root用户启动
11. 使用火狐浏览器访问:http://192.168.142.115:5601/app/marvel
12. 集群状态检查
---http://192.168.142.115:9200/_cluster/health?pretty
13\安装火狐插件rest easy,可以直接访问查询
#[root@hh15 ~]# curl -XGET http://hh15:9200/
# curl -XPUT 'hh15:9200/test1/' -d'{"settings":{"number_of_shards":3}}'
14\退出,只需kill -9 线程号即可,或者关闭窗口
标签:opt,--,com,elasticsearch,2.2,ElasticSearch,soft,marvel From: https://blog.51cto.com/u_13966077/5819865