Elasticsearch三节点安装

版本说明

java版本控制1.8以上
Elasticsearch版本为5.5.1

JAVA安装说明

查看centos源版本open jdk

 rpm -qa | grep java

删除已有版本

 yum remove java*

安装java jdk 1.8.144,至/opt目录

su - root
mv /home/didichen/Downloads/jdk-8u144-linux-x64.tar.gz  /opt/
tar -zxvf jdk-8u144-linux-x64.tar.gz
vim /etc/profile

----
JAVA_HOME=/opt/jdk1.8.0_144
export JAVA_HOME
export PATH=\$JAVA_HOME/bin:$PATH
----
source /etc/profile

OS更改配置(root权限,多节点部署时,需要此步骤)

建议修改如下配置,否则在多节点部署时会报错

修改vm.max_map_count配置

# echo "vm.max_map_count=262144" >>/etc/sysctl.conf
# sysctl -p
vm.max_map_count = 262144

修改max file descriptors配置

# echo "didichen hard nofile 65536" >> /etc/security/limits.conf 
# echo "didichen soft nofile 65536" >> /etc/security/limits.conf 

重新登陆登录didichen(这个是运行es的账号)

关闭防火墙

systemctl stop firewalld.service 

Elasticsearch安装

下载

https://www.elastic.co/downloads/elasticsearch

单节点安装

cd elasticsearch-5.5.1/
bin/elasticsearch

多节点安装

配置规划

集群名称为es-cocacola

ipnode对外port对内port
192.168.220.128node-12892009300
192.168.220.129node-12992009300
192.168.220.130node-13092009300

修改多节点配置

elasticsearch-5.5.1/config/elasticsearch.yml

![这里写图片描述]192.168.220.128
cluster.name: es-cocacola
node.name: node-128
network.host: 192.168.220.128
http.port: 9200
discovery.zen.ping.unicast.hosts: ["192.168.220.128", "192.168.220.129", "192.168.220.130"]
discovery.zen.minimum_master_nodes: 2
192.168.220.129
cluster.name: es-cocacola
node.name: node-129
network.host: 192.168.220.129
http.port: 9200
discovery.zen.ping.unicast.hosts: ["192.168.220.128", "192.168.220.129", "192.168.220.130"]
discovery.zen.minimum_master_nodes: 2
192.168.220.130
cluster.name: es-cocacola
node.name: node-130
network.host: 192.168.220.130
http.port: 9200
discovery.zen.ping.unicast.hosts: ["192.168.220.128", "192.168.220.129", "192.168.220.130"]
discovery.zen.minimum_master_nodes: 2

在多个节点启动es

cd elasticsearch-5.5.1/
bin/elasticsearch

集群自发现

节点访问

访问

curl http://192.168.220.128:9200
[didichen@centos7-x64-id1 ~]$ curl http://192.168.220.128:9200
{
  "name" : "node-128",
  "cluster_name" : "es-cocacola",
  "cluster_uuid" : "9v9CkYFzQ56BD1QHgn0M_A",
  "version" : {
    "number" : "5.5.1",
    "build_hash" : "19c13d0",
    "build_date" : "2017-07-18T20:44:24.823Z",
    "build_snapshot" : false,
    "lucene_version" : "6.6.0"
  },
  "tagline" : "You Know, for Search"
}
[didichen@centos7-x64-id1 ~]$ curl http://192.168.220.129:9200
{
  "name" : "node-129",
  "cluster_name" : "es-cocacola",
  "cluster_uuid" : "9v9CkYFzQ56BD1QHgn0M_A",
  "version" : {
    "number" : "5.5.1",
    "build_hash" : "19c13d0",
    "build_date" : "2017-07-18T20:44:24.823Z",
    "build_snapshot" : false,
    "lucene_version" : "6.6.0"
  },
  "tagline" : "You Know, for Search"
}
[didichen@centos7-x64-id1 ~]$ curl http://192.168.220.130:9200
{
  "name" : "node-129",
  "cluster_name" : "es-cocacola",
  "cluster_uuid" : "9v9CkYFzQ56BD1QHgn0M_A",
  "version" : {
    "number" : "5.5.1",
    "build_hash" : "19c13d0",
    "build_date" : "2017-07-18T20:44:24.823Z",
    "build_snapshot" : false,
    "lucene_version" : "6.6.0"
  },
  "tagline" : "You Know, for Search"
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值