手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

ELK Stack集群部署与Grafana及可视化图形

[日期:2017-06-19] 来源:Linux社区  作者:思考 [字体:大 中 小]

5、安装部署elasticsearch集群

5.1分别在三台服务器安装:

172.16.8.206  ops-elk06

172.16.8.207  ops-elk07

172.16.8.208  ops-elk08

 

5.2安装完Java

yum -y install java

java -version

openjdk version "1.8.0_121"

OpenJDK Runtime Environment (build 1.8.0_121-b13)

OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)

 

5.3elasticsearch集群安装

rpm -ivh elasticsearch-2.4.1.rpm 

systemctl enable elasticsearch.service

systemctl start elasticsearch.service

 

5.4修改配置文件

-------------------------------------------------------------------------------------------

修改ES配置文件172.16.8.206   ops-elk06

mkdir -p /data/elasticsearch/{data,logs}

chown -R elasticsearch.elasticsearch /data/elasticsearch/

grep -n '^[a-Z]' /etc/elasticsearch/elasticsearch.yml

17:cluster.name: app-elk

23:node.name: ops-elk06

33:path.data: /data/elasticsearch/data

37:path.logs: /data/elasticsearch/logs

43:bootstrap.memory_lock: true

54:network.host: 0.0.0.0

58:http.port: 9200

68:discovery.zen.ping.unicast.hosts: ["172.16.8.207", "172.16.8.208"]

72:discovery.zen.minimum_master_nodes: 3

 

修改ES配置文件172.16.8.207  ops-elk07

grep -n '^[a-Z]' /etc/elasticsearch/elasticsearch.yml

17:cluster.name: app-elk

23:node.name: ops-elk07

33:path.data: /data/elasticsearch/data

37:path.logs: /data/elasticsearch/logs

43:bootstrap.memory_lock: true

54:network.host: 0.0.0.0

58:http.port: 9200

68:discovery.zen.ping.unicast.hosts: ["172.16.8.206", "172.16.8.208"]

72:discovery.zen.minimum_master_nodes: 3

 

修改ES配置文件172.16.8.208  ops-elk08

grep -n '^[a-Z]' /etc/elasticsearch/elasticsearch.yml 

17:cluster.name: app-elk

23:node.name: ops-elk08

33:path.data: /data/elasticsearch/data

37:path.logs: /data/elasticsearch/logs

43:bootstrap.memory_lock: true

54:network.host: 0.0.0.0

58:http.port: 9200

68:discovery.zen.ping.unicast.hosts: ["172.16.8.206", "172.16.8.207"]

72:discovery.zen.minimum_master_nodes: 3

-------------------------------------------------------------------------------------------

5.5安装插件

/usr/share/elasticsearch/bin/plugin list

/usr/share/elasticsearch/bin/plugin install license

/usr/share/elasticsearch/bin/plugin install mobz/elasticsearch-head

/usr/share/elasticsearch/bin/plugin install lmenezes/elasticsearch-kopf

/usr/share/elasticsearch/bin/plugin install marvel-agent

 

安装bigdesk 插件

cd /usr/share/elasticsearch/plugins

mkdir bigdesk

cd bigdesk/

git clone https://github.com/lukas-vlcek/bigdesk _site

sed -i '142s/==/>=/' _site/js/store/BigdeskStore.js

cat >plugin-descriptor.properties<<EOF

description=bigdesk - Live charts and statistics for Elasticsearch cluster.

version=2.5.1

site=true

name=bigdesk

EOF

 

http://172.16.8.206:9200

wKiom1iyWPWz3emGAADjPAuMgI8485.png

http://172.16.8.207:9200

wKioL1iyWQaRcvTSAADATx3Go0g212.png

http://172.16.8.208:9200

wKiom1iyWRbTBmkmAADkDfo0LDM198.png

http://172.16.8.206:9200/_plugin/head/

wKioL1iyWUaTzq9YAAFgPNatVAM299.png

http://172.16.8.207:9200/_plugin/head/

wKiom1iyWVqh4wRiAAHL0FaY4Tc266.png

http://172.16.8.208:9200/_plugin/head/

wKioL1iyWXrA1odKAAFgPNatVAM129.png

http://172.16.8.206:9200/_plugin/kopf/#!/cluster

wKiom1iyWmDhe5BeAAGUYWPhYVY705.png

http://172.16.8.207:9200/_plugin/kopf/#!/cluster

wKiom1iyWnShftrfAAGMt5qIShQ464.png

http://172.16.8.208:9200/_plugin/kopf/#!/cluster

wKioL1iyWoOyyiEvAAGMt5qIShQ025.png

 

http://172.16.8.206:9200/_plugin/bigdesk/

wKioL1iyWq_RyIuXAAGtR2bLako617.png

查看集群状态:curl -XGET http://localhost:9200/_cat/health?v

查看集群节点:curl -XGET http://localhost:9200/_cat/nodes?v

查询索引列表:curl -XGET http://localhost:9200/_cat/indices?v

创建索引:curl -XPUT http://localhost:9200/customer?pretty

查询索引:curl -XGET http://localhost:9200/customer/external/1?pretty

删除索引:curl -XDELETE http://localhost:9200/customer?pretty

linux
相关资讯       Grafana  ELK Stack集群 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款