centos7 Elasticsearch 7.15 与Kibana 7.15 部署(rpm方式)

本文档介绍了在 CentOS7 上部署 Elasticsearch 7.15 和 Kibana 7.15 的过程,包括关闭防火墙、安装Elasticsearch、配置集群、安装Kibana以及验证安装和设置开机自启动的步骤。
摘要由CSDN通过智能技术生成

准备: 

elasticsearch-7.15.0-x86_64.rpm

kibana-7.15.0-x86_64.rpm

注:一定要同版本

三台服务器(虚拟ip)

192.168.21.11

192.168.21.12

192.168.21.13

关闭防火墙(所有):

启动:systemctl start firewalld

关闭:systemctl stop firewalld

查看状态:systemctl status firewalld

开机禁用:systemctl disable firewalld

开机启用:systemctl enable firewalld
 

安装步骤首先安装Elasticsearch(所有))

使用命令

rpm -ivh elasticsearch-7.15.0-x86_64.rpm

进行安装安装后

执行命令进行启动

systemctl start elasticsearch.service

启动成功后执行命令

curl 192.168.21.11:9200

返回如下表示成功

按照如下修改配置文件 /etc/elasticsearch (所有节点)

# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /var/lib/elasticsearch
#
# Path to log files:
#
path.logs: /var/log/elasticsearch
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# By default Elasticsearch is only accessible on localhost. Set a different
# address here to expose this node on the network:
#
network.host: 0.0.0.0
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
#
#http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.seed_hosts: ["192.168.21.11:9300", "192.168.21.12:9300","192.168.21.13:9300"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["192.168.21.11:9300"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

其中 cluster.name :集群名  (注:需三台全部一致)

        node.name:节点名 (注:三台不能一致)

        discovery.seed_hosts:所有节点的ip

        cluster.initial_master_nodes: master预选节点 只有master配置就行 只需一个节点配

其余按文档固定配置就可以,配置完成后执行命令(所有)

/etc/security/limits.conf文件下end前添加:

* soft nofile 65536
* hard nofile 65536

添加后执行: 

echo 'vm.max_map_count=655360' >> /etc/sysctl.conf

#查看配置,如果未生效重启配置
ulimit -n

修改后执行命令重启(所有)

systemctl restart elasticsearch.service

重启后,在网页执行

http://192.168.21.11:9200/_cluster/state?pretty

得到如图结果

 表示集群配置完毕。

接下来安装Kibana (选择一台进行安装即可)

使用命令安装rpm

rpm -ivh kibana-7.15.0-x86_64.rpm

安装后修改kibana.yml配置文件使用如下配置:

server.port: 5601
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://localhost:9200"]
i18n.locale: "zh-CN"
配置完成执行命令进行启动
//启动服务
systemctl start kibana.service
//查看状态
systemctl status kibana.service
//停止服务
systemctl stop kibana.service

启动后通过 http://192.186.21.11:5601/ 进行访问

附录

访问后可通过

栏输入 

GET /_cat/nodes?v

查询当前集群节点。

通过执行如下命令设置开机自启动:

// kibana 设置服务开机自启
systemctl enable kibana.service
// es 开机自启
systemctl daemon-reload
systemctl enable elasticsearch.service 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值