Skip to content

服务器托管|北京服务器租用|机房托管租用|IDC托管租用|机房机柜带宽租用-价格及费用咨询

Menu
  • 首页
  • 关于我们
  • 新闻资讯
  • 数据中心
  • 服务器托管
  • 服务器租用
  • 机房租用
  • 支持中心
  • 解决方案
  • 联系我们
Menu

ElasticSearch 集群安装

Posted on 2024年7月7日2024年7月7日 by hackdl

一、ElasticSearch

ElasticSearch 官网:Elasticsearch: The Official Distributed Search & Analytics Engine | Elastic
官网下载地址:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.tar.gz


二、ElasticSearch安装


1、环境介绍:

Elasticsearch:5.5.2版本
操作系统:Centos 6.5
JDK: 1.8
集群节点3台:es01;es02;es03


2、ES集群安装


1>用户创建

创建用户e服务器托管网s,家目录设置/usr/local/elasticsearch


2>jdk安装

root上传jdk1.8.0_121.tar到/usr/java并解压
tar -xvf jdk1.8.0_121.tar
切换到es用户,修改.bash_profile文件,添加以下内容:
export JAVA_HOME=/usr/java/jdk1.8.0_121
PATH=$JAVA_HOME/bin:$PATH:$HOME/bin
执行命令 source .bash_profile生效


3>系统参数设置

  1. 设置内核参数
    vim /etc/sysctl.conf
    添加如下内容:
    fs.file-max=65536
    vm.max_map_count=262144
  2. 设置资源参数

vim /etc/security/limits.conf
添加如下内容:

* soft nofile 65535
* hard nofile 65535
* soft nproc 4096
* hard nproc 4096
* soft memlock unlimited
* hard memlock unlimited

执行命令sysctl –p 使配置生效

4>elasticsearch安装

上传elasticsearch-5.5.0.zip包到/usr/local/elasticsearch目录并解压
unzip elasticsearch-5.5.0.zip
删除解压目录的下的原始文件夹
/usr/local/elasticsearch/elasticsearch-5.5.0/data/nodes


5>elasticsearch配置

备份elasticsearch.yml文件

---------------------------------- Cluster -----------------------------------
cluster.name: lcs-elasticsearch
#集群名称,不能和别的集群同名

------------------------------------ Node ------------------------------------
node.name: es01.lcs.sfp.com
#节点名称,每个节点建议改成hostname
node.master: true
#该节点是否有资格被选为master
node.data: true
#指定该节点是否存储索引数据,默认为true。如果节点配置node.master:false并且node.data: false,则该节点将起到负载均衡的作用

----------------------------------- Paths ------------------------------------
path.data: /usr/local/elasticsearch/elasticsearch-5.5.0/data

#Path to log files:

path.logs: /usr/local/elasticsearch/elasticsearch-5.5.0/logs
#es存储数据的路径和日志路径



----------------------------------- Memory -----------------------------------


#Lock the memory on startup:

bootstrap.memory_lock: true

#这个配置的意义:锁定物理内存地址,防止es内存被交换出去,也就是避免es使用swap交换分区,频繁的交换,会导致IOPS变高

bootstrap.system_call_filter: false
#问题原因:因为Centos6不支持SecComp
#SecComp是Linux kernel (自从2.6.23版本之后)所支持的一种简洁的sandboxing机制。它能使一个进程进入到一种“安全”运行模式,该模式下的进程只能调用4种系统调用(system calls),即read(), write(), exit()和sigreturn(),否则进程便会被终止。
而ES5.2以后的版本默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。修改为false直接不检查

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 -----------------------------------


#Set the bind address to a specific IP (IPv4 or IPv6):

network.host: 0.0.0.0
#允许访问的IP,设置0.0.0.0允许所有IP访问

Set a custom port for HTTP:

http.port: 9200
#为esrestapi的端口号
transport.tcp.port: 9300
#为集群间通信端口

#For more information, consult the network module documentation.

#--------------------------------- Discovery ----------------------------------
#Pass an initial list of hosts to perform discovery when new node is started:

#The default list of hosts is ["127.0.0.1", "[::1]"]

discovery服务器托管网.zen.ping.unicast.hosts: ["es01.lcs.sfp.com", "es02.lcs.sfp.com"]
#集群的所有主机地址

#Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):

discovery.zen.minimum_master_nodes: 2
#了防止集群发生“脑裂”, 需要配置集群最少主节点数目,通常为 (可成为主节点的主机数目 / 2) + 1

#For more information, consult the zen discovery module documentation.

---------------------------------- Gateway -----------------------------------
#Block initial recovery after a full cluster restart until N nodes are started:

#gateway.recover_after_nodes: 3

#For more information, consult the gateway module documentation.

---------------------------------- Various -----------------------------------
#Require explicit names when deleting indices:

#action.destructive_requires_name: true

服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net

相关推荐: 【数据结构】哈希表的开散列和闭散列模拟

哈希思想 在顺序和树状结构中,元素的存储与其存储位置之间是没有对应关系,因此在查找一个元素时,必须要经过多次的比较。 顺序查找的时间复杂度为0(N),树的查找时间复杂度为log(N)。 我们最希望的搜索方式:通过元素的特性,不需要对比查找,而是直接找到某个元素…

服务器托管,北京服务器托管,服务器租用,机房机柜带宽租用

服务器托管

咨询:董先生

电话13051898268 QQ/微信93663045!

上一篇: 实现HBase表和RDB表的转化(附Java源码资源)
下一篇: Linux服务器(Debian系)包含UOS安全相关巡检shell脚本

关于我们

本公司主要经营服务器托管,服务器租用,IDC机房托管租用,数据中心租赁,电信联通移动BGP多线带宽租用租赁,GPU服务器托管,超算机房租用,机房高电机柜租用,带宽传输,互联网接入,多种云计算增值服务,可一站式提供AI人工智能,金融证券银行,游戏视频电商等各种解决方案,欢迎咨询!

客服咨询

  • 董先生
  • 微信/QQ:93663045
  • 电话:13051898268
  • 邮箱:dongli@hhisp.com
  • 地址:北京市石景山区重聚园甲18号2层

友情链接

  • 服务器托管租用
  • IDC机房托管
  • IDC机房租用租赁
  • IDC机房机柜租用
  • 北京机房托管
  • 北京机房租用租赁
  • 机房托管价格费用
  • 机房机柜租用租赁价格
  • 机房机柜带宽租用
  • 主机托管租用
  • GPU服务器托管
  • GPU服务器机房租用
  • 服务器托管
  • 北京服务器托管
  • 机房服务器托管
  • 机房托管租赁
  • 机房机柜租用
  • IDC托管租用
  • 机房托管租用
  • GPU服务器托管
  • 服务器托管
©2024 服务器托管|北京服务器租用|机房托管租用|IDC托管租用|机房机柜带宽租用-价格及费用咨询 京ICP备13047091号-8