elasticsearch集群搭建

1、配置java环境

2、配置内核参数

vim /etc/security/limits.conf

* soft nofile 65536

* hard nofile 65536

* soft nproc 2048

* hard nproc 2048

* soft memlock unlimited

* hard memlock unlimited

3、安装配置elasticsearch

1、下载安装

下载Past Releases of Elastic Stack Software | Elastic

rpm -ivh elasticsearch-7.7.1-x86_64.rpm

2、配置

## 配置模板:

vim /etc/elasticsearch/elasticsearch.yml

cluster.name: elk-cluster

node.master: true

node.data: true

node.name: 自己的主机名

path.data: /data/elk/data #数据存放目录

path.logs: /data/elk/log #日志存放目录

network.host: 自己的IP地址

http.port: 9200

discovery.zen.minimum_master_nodes: 1

http.cors.enabled: true

http.cors.allow-origin: "*"

discovery.seed_hosts: ["ip","ip"]

cluster.initial_master_nodes: ["ip","ip"]

3、修改数据与目录所属组

chown -R elasticsearch:elasticsearch /data/elk/data

chown -R elasticsearch:elasticsearch /data/elk/log

4、启动

systemctl start elasticsearch

systemctl enable elasticsearch

检查端口 9200

 

posted @ 2022-09-20 19:46  GUAtiger  阅读(7)  评论(0)    收藏  举报