Es集群&kibana

环境准备,防火墙&selinux

[root@localhost ~]#systemctl stop firewalld
[root@localhost ~]#systemctl disable firewalld
[root@localhost ~]#sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
[root@localhost ~]#setenforce 0

##修改系统环境该变量,修改完需要重启才能生效!!

[root@localhost ~]#echo 'vm.max_map_count=262144' >> /etc/sysctl.conf

##允许打开的最大文件描述

[root@localhost ~]#echo '
* soft memlock unlimited
* hard memlock unlimited

* soft nofile 65536
* hard nofile 131072

* soft nproc 2048
* hard nproc 4096
' >> /etc/security/limits.conf
[root@localhost ~]#ulimit -n 65535
[root@localhost ~]#sysctl -p

安装jdk

[root@localhost ~]#yum install -y java-1.8.0-openjdk
[root@localhost ~]#useradd es
[root@localhost ~]#passwd es

安装es

安装es

[root@localhost ~]#wget  https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.6.2.tar.gz

##没外网手动下载包上传

[root@localhost ~]#tar -axf elasticsearch-6.6.2.tar.gz  -C /opt/
[root@localhost ~]#chown -R es:es /opt/elasticsearch-6.6.2/
[root@localhost ~]#cd /opt/elasticsearch-6.6.2/

#修改JVM分配大小 3G这两个值要一致

[root@localhost ~]#vim ./config/jvm.options

在这里插入图片描述

修改配置文件,添加参数

[root@localhost ~]#echo 'cluster.name: my-es
node.name: es002
node.master: true
node.data:true
network.host: 152.215.131.172
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["es002", "es003",”es004”]
discovery.zen.minimum_master_nodes: 2
http.cors.enabled: true
http.cors.allow-origin: "*"
' >> /opt/elasticsearch-6.6.2/config/elasticsearch.yml

修改本地解析hosts

[root@localhost ~]# echo '152.215.131.172 my-es_es002
152.215.131.173 my-es_es003
152.215.131.174 my-es_es004'>> /ets/hosts

以es用户启动服务

[root@localhost ~]#su - es -c "sh /opt/elasticsearch-6.6.2/bin/elasticsearch &> /home/es/run.txt &"

检测集群状态

[root@localhost ~]#curl  http://152.215.131.172:9200/_cluster/health?pretty

安装head插件

安装kibana

###安装kibana

[root@localhost ~]#wget https://artifacts.elastic.co/downloads/kibana/kibana-6.6.2-linux-x86_64.tar.gz
[root@localhost ~]#tar -axf kibana-6.6.2-linux-x86_64.tar.gz  -C /opt
[root@localhost ~]#vim /opt/kibana-6.6.2-linux-x86_64/config/kibana.yml

修改三个字段
server.port: 5601 #服务端口
server.host: “0.0.0.0” #监听地址
elasticsearch.hosts: [“http://152.215.131.172:9200”] #es地址

##启动命令

[root@localhost ~]#nohup /opt/kibana-6.6.2-linux-x86_64/bin/kibana > /tmp/kibana.log 2>&1 & 

Kibana访问地址:http://152.215.131.171:5601
在这里插入图片描述
检查es集群以及kibana状态是否正常

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Rio520

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值