elasticsearch6.x集群安装

本文详细介绍了如何在CentOS 6.5环境下部署Elasticsearch集群,包括环境配置、节点安排、配置文件修改及异常解决等内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

elasticsearch 安装

环境
操作系统:centos6.5 64位
版本:elasticsearch-6.1.1
jdk版本:1.8
安装用户:etl

节点安排
10.20.23.29 master
10.20.23.38 负载均衡
10.20.23.41 data
10.20.23.42 data
10.20.23.82 data

解压elasticsearch
unzip elasticsearch-6.1.1.zip

修改elasticsearch 的配置文件
修改conf目录下面的 elasticsearch.yml文件

cluster.name: es_dev
node.name: node-5
#如果是master节点设置成true 如果是
node.master: false
#如果是data节点设置成true
node.data: true
path.data: /data/elasticsearch-6.1.1/data
path.logs: /data/elasticsearch-6.1.1/logs
network.host: 10.20.23.82
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["10.20.23.29", "10.20.23.38","10.20.23.41","10.20.23.42","10.20.23.82"]
discovery.zen.minimum_master_nodes: 1
bootstrap.memory_lock: true
bootstrap.system_call_filter: false
http.cors.enabled: true
http.cors.allow-origin: "*"

启动elasticsearch 服务
./elasticsearch -d

验证
在浏览器上输入 http://10.20.23.29:9200/_cluster/health?pretty


{
  "cluster_name" : "es_dev",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 5,
  "number_of_data_nodes" : 3,
  "active_primary_shards" : 0,
  "active_shards" : 0,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0
}

异常解决

[etl@node1 logs]$ tail -f es_dev.log 
[2018-01-29T10:25:19,090][INFO ][o.e.b.BootstrapChecks    ] [node-1] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
[2018-01-29T10:25:19,093][ERROR][o.e.b.Bootstrap          ] [node-1] node validation exception
[3] bootstrap checks failed
[1]: memory locking requested for elasticsearch process but memory is not locked
[2]: max number of threads [1024] for user [etl] is too low, increase to at least [4096]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决方案
修改 /etc/security/limits.conf
增加

*       soft    nofile  65536
*       hard    nofile  131072
etl     soft    memlock unlimited
etl     hard    memlock unlimited
etl     hard    nproc   4096
etl     soft    nproc   4096

修改 /etc/sysctl.conf
增加

vm.max_map_count=262144
vm.swappiness=1

用命令sysctl -p 生效
sysctl vm.max_map_count 查看值是否修改, 也可以通过sysctl -w vm.max_map_count=262144 临时设置值

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值