ElasticSearch 7.13 集群部署和kibana图形界面和elasticsearch-head chrom调试插件

ElasticSearch 7.13 集群部署

1、实验所需组件及环境

1)JDK8以上环境

2)CentOS7.6,

IP地址:192.168.1.178, 192.168.1.179, 192.168.1.180

3)elasticsearch7.13

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.13.0-linux-x86_64.tar.gz

2、安装jdk8以上版本

yum install java -y

java -version 查看java版本

3、安装部署elasticsearch

解压包命令

tar -zxvf elasticsearch-7.13.0-linux-x86_64.tar.gz

转移elasticsearch文件夹

mv elasticsearch-7.13.0 /opt/elasticsearch

  • 创建独立用户与组(root用户下创建设定)

创建es组

groupadd es

创建ela用户,并且加入ela组

useradd -g es es

设置用户权限

visudo(或者vim /etc/sudoers)

#创建data文件夹

mkdir /opt/elasticsearch/data

#赋予权限

sudo chown -R es.es /opt/elasticsearch

sudo chmod -R 777 /opt/elasticsearch

修改:/etc/security/limits.conf

vim /etc/security/limits.conf

# 在文件末尾追加下面内容

* hard nofile 65536

* soft nofile 65536

修改:/etc/sysctl.conf

vim /etc/sysctl.conf

# 在文件末尾追加下面内容

vm.max_map_count=655360

# 执行命令刷新配置

sysctl -p

4、配置文档

修改es配置文件:

vim /opt/elasticsearch/config/elasticsearch.yml

配置内容如下:

# 集群名称,集群中的各节点此名称必须一致

cluster.name: my-application

# 节点名称,集群中的各节点名称不重复,另一个节点设置为 node-2

node.name: node-1

# 数据文件路径

path.data: /opt/elasticsearch/data

# 日志文件路径

path.logs: /opt/elasticsearch/logs

# 本机服务器 IP

network.host: 192.168.1.178

# elasticsearch 访问端口

http.port: 9200

# 集群中的主机列表 通讯端口默认 9300

discovery.seed_hosts: ["192.168.1.178:9300", "192.168.1.179:9300", "192.168.1.180:9300"]

# 设置主节点,这里设置 3个集群都为主节点方式某一宕机

cluster.initial_master_nodes: ["node-1", "node-2", "node-3"]

# 防止 head 插件链接跨域(可选)

http.cors.enabled: true

http.cors.allow-origin: "*"

# 设置主机为节点和储存数据

node.master: true

node.data: true

# 关闭机器学习功能

xpack.ml.enabled: false

xpack.security.enabled: false

# 配置运行内存

vim /opt/elasticsearch/config/jvm.options

-Xms512m

-Xmx512m

# 运行elasticsearch

切换用户

su es

后台运行

cd /opt

./elasticsearch/bin/elasticsearch -d

# 暂定未添加

注意Centos7服务里面需要配置内存锁定

vim systemctl edit elasticsearch

添加以下内容

[Service]

LimitMEMLOCK=infinity

[root@elasticsearch01 ~]# systemctl daemon-reload

开机自动启动

centos7设置elasticsearch开机自启动-CSDN博客

5、elasticsearch-head插件安装

Chrome extension

chorme 网上应用店

搜索 elasticsearch-head

连接elasticsearch服务器

6、安装Kibana

Kibana 是一个基于 WEB 的 Elasticsearch 管理控制台。在 Linux 中安装 Kibana 很方便。解压,启动即可。Kibana 要求的环境配置是小于 Elasticsearch 的要求的。

#下载安装

wget https://artifacts.elastic.co/downloads/kibana/kibana-7.13.0-linux-x86_64.tar.gz

tar -zxvf kibana-7.13.0-linux-x86_64.tar.gz

#配置文档

vi /etc/kibana/kibana.yml

#修改以下配置

# Kibana is served by a back end server. This setting specifies the port to use.

server.port: 5601

# Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values.

# The default is 'localhost', which usually means remote machines will not be able to connect.

# To allow connections from remote users, set this parameter to a non-loopback address.

server.host: "192.168.1.178"

xpack.ml.enabled: false

xpack.security.enabled: false

# 开放5601端口和#配置立即生效

firewall-cmd --zone=public --add-port=5601/tcp --permanent

firewall-cmd --reload

  • kibana 启动命令

#开机启动

systemctl enable kibana

#启动程序

systemctl start kibana

#重启程序

systemctl restart kibana

#暂停程序

systemctl stop kibana

#程序状态

systemctl status kibana

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值