Linux ES集群服务配置说明
2017-08-30 11:58
232 查看
说明:
ES官网不建议在root用户使用Elastic Server,因此ES集群配置均使用普通账户操作,新建账户 elastic。
Linux版本为CentOS 7.3,ES版本为5.5.0.
一、下载并安装ES程序
下载路径:/home/elastic
下载指令:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.tar.gz 安装指令:tar -zxvf elasticsearch-5.5.0.tar.gz
二、系统参数设置
为了让ES服务正常启动,需要设置如下参数(root用户权限):
1、修改max file descriptors参数
vim /etc/security/limits.conf打开limits文件
添加或修改如下两行参数:
* hard nofile 65536
* soft nofile 65536
查看设置参数是否生效指令:
ulimit -Hn
注:账户需要注销后重新登录方可查看设置值。
此设置参数对应ES启动错误如下:
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
2、修改vm.max_map_count参数
1)临时修改方法:
sysctl -w vm.max_map_count=262144
sysctl -p
查看参数指令:
sysctl -a | grep "vm.max_map_count"
注:主机重启后,参数会还原。
2)永久修改方法:
vim /etc/sysctl.conf添加vm.max_map_count=262144,保存后执行sysctl -p即可。
此设置参数对应ES启动错误如下:
max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
三、ES集群配置
客户端节点Clinet:
内网ip:172.26.178.100
elasticsearch.yml参数配置:路径/home/elastic/elasticsearch-5.5.0/config
修改文件参数如下:
cluster.name: tuyou-application
node.name: node-195
#client节点设置
node.master: false
node.data: false
network.host: 172.26.178.100
http.port: 9200
#查询master节点地址列表
discovery.zen.ping.unicast.hosts: ["172.26.178.99", "172.26.178.98"]
#配合head插件管理ES集群
http.cors.enabled: true
http.cors.allow-origin: "*"
混合节点Master/Data:
内网ip:172.26.178.99
elasticsearch.yml参数配置:
修改文件参数如下:
cluster.name: tuyou-application
node.name: node-255
network.host: 172.26.178.99
http.port: 9200
discovery.zen.ping.unicast.hosts: ["172.26.178.98", "172.26.178.99"]
discovery.zen.minimum_master_nodes: 2
混合节点Master/Data:
内网ip:172.26.178.98
elasticsearch.yml参数配置:
修改文件参数如下:
cluster.name: tuyou-application
node.name: node-150
network.host: 172.26.178.98
http.port: 9200
discovery.zen.ping.unicast.hosts: ["172.26.178.99", "172.26.178.98"]
discovery.zen.minimum_master_nodes: 2
四、安装分词插件
注:Client节点无需安装
插件包括:ik中文分词插件,pinyin拼音分词插件,注意插件版本应和ES版本一致。
分别将插件文件夹拷贝到ES的plugins路径,路径地址如下:
/home/elastic/elasticsearch-5.5.0/plugins
Ik插件配置说明:
路径:/home/elastic/elasticsearch-5.5.0/plugins/ik/config下的IKAnalyzer.cfg.xml文件。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>IK Analyzer 扩展配置</comment>
<!--用户可以在这里配置自己的扩展字典 -->
<entry key="ext_dict">custom/mydict.dic;custom/single_word_low_freq.dic;custom/sougou.dic</entry>
<!--用户可以在这里配置自己的扩展停止词字典-->
<entry key="ext_stopwords">custom/ext_stopword.dic</entry>
<!--用户可以在这里配置远程扩展字典 -->
<!-- <entry key="remote_ext_dict">http://192.168.1.152:8080/tour/interface/getCustomDict.htm</entry> -->
<!--用户可以在这里配置远程扩展停止词字典-->
<!-- <entry key="remote_ext_stopwords">words_location</entry> -->
</properties>
注:外部词典暂时关闭。
五、启动服务
三台服务均切换到elastic用户,所处路径为:
/home/elastic
执行如下指令,后台启动ES服务:
./elasticsearch-5.5.0/bin/elasticsearch -d
查看ES服务进程指令:
ps -ef | grep elasticsearch
启动后,可通过如下命令查看服务是否正常运行:
curl http://内网ip:9200/
ES官网不建议在root用户使用Elastic Server,因此ES集群配置均使用普通账户操作,新建账户 elastic。
Linux版本为CentOS 7.3,ES版本为5.5.0.
一、下载并安装ES程序
下载路径:/home/elastic
下载指令:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.tar.gz 安装指令:tar -zxvf elasticsearch-5.5.0.tar.gz
二、系统参数设置
为了让ES服务正常启动,需要设置如下参数(root用户权限):
1、修改max file descriptors参数
vim /etc/security/limits.conf打开limits文件
添加或修改如下两行参数:
* hard nofile 65536
* soft nofile 65536
查看设置参数是否生效指令:
ulimit -Hn
注:账户需要注销后重新登录方可查看设置值。
此设置参数对应ES启动错误如下:
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
2、修改vm.max_map_count参数
1)临时修改方法:
sysctl -w vm.max_map_count=262144
sysctl -p
查看参数指令:
sysctl -a | grep "vm.max_map_count"
注:主机重启后,参数会还原。
2)永久修改方法:
vim /etc/sysctl.conf添加vm.max_map_count=262144,保存后执行sysctl -p即可。
此设置参数对应ES启动错误如下:
max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
三、ES集群配置
客户端节点Clinet:
内网ip:172.26.178.100
elasticsearch.yml参数配置:路径/home/elastic/elasticsearch-5.5.0/config
修改文件参数如下:
cluster.name: tuyou-application
node.name: node-195
#client节点设置
node.master: false
node.data: false
network.host: 172.26.178.100
http.port: 9200
#查询master节点地址列表
discovery.zen.ping.unicast.hosts: ["172.26.178.99", "172.26.178.98"]
#配合head插件管理ES集群
http.cors.enabled: true
http.cors.allow-origin: "*"
混合节点Master/Data:
内网ip:172.26.178.99
elasticsearch.yml参数配置:
修改文件参数如下:
cluster.name: tuyou-application
node.name: node-255
network.host: 172.26.178.99
http.port: 9200
discovery.zen.ping.unicast.hosts: ["172.26.178.98", "172.26.178.99"]
discovery.zen.minimum_master_nodes: 2
混合节点Master/Data:
内网ip:172.26.178.98
elasticsearch.yml参数配置:
修改文件参数如下:
cluster.name: tuyou-application
node.name: node-150
network.host: 172.26.178.98
http.port: 9200
discovery.zen.ping.unicast.hosts: ["172.26.178.99", "172.26.178.98"]
discovery.zen.minimum_master_nodes: 2
四、安装分词插件
注:Client节点无需安装
插件包括:ik中文分词插件,pinyin拼音分词插件,注意插件版本应和ES版本一致。
分别将插件文件夹拷贝到ES的plugins路径,路径地址如下:
/home/elastic/elasticsearch-5.5.0/plugins
Ik插件配置说明:
路径:/home/elastic/elasticsearch-5.5.0/plugins/ik/config下的IKAnalyzer.cfg.xml文件。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>IK Analyzer 扩展配置</comment>
<!--用户可以在这里配置自己的扩展字典 -->
<entry key="ext_dict">custom/mydict.dic;custom/single_word_low_freq.dic;custom/sougou.dic</entry>
<!--用户可以在这里配置自己的扩展停止词字典-->
<entry key="ext_stopwords">custom/ext_stopword.dic</entry>
<!--用户可以在这里配置远程扩展字典 -->
<!-- <entry key="remote_ext_dict">http://192.168.1.152:8080/tour/interface/getCustomDict.htm</entry> -->
<!--用户可以在这里配置远程扩展停止词字典-->
<!-- <entry key="remote_ext_stopwords">words_location</entry> -->
</properties>
注:外部词典暂时关闭。
五、启动服务
三台服务均切换到elastic用户,所处路径为:
/home/elastic
执行如下指令,后台启动ES服务:
./elasticsearch-5.5.0/bin/elasticsearch -d
查看ES服务进程指令:
ps -ef | grep elasticsearch
启动后,可通过如下命令查看服务是否正常运行:
curl http://内网ip:9200/
相关文章推荐
- ehcache集群缓存配置说明
- [轉]MYSQL集群服务配置
- kafka的集群安装及配置文件说明
- mac svn 服务配置 客户端连接说明
- linux中DHCP服务配置文件/etc/dhcpd.conf详细说明
- Linux高性能集群常用服务简介与配置(二)——NFS(网络文件系统)
- 基于【CentOS-7+ Ambari 2.7.0 + HDP 3.0】搭建HAWQ数据仓库——安装配置NTP服务,保证集群时间保持同步
- memcache集群服务:memagent配置使用
- mysql服务性能优化—my.cnf配置说明详解
- mysql服务性能优化—my.cnf配置说明详解(再次记录下,老是忘掉)
- 插件开发技术说明(14)---服务配置访问
- Ubuntu下Mysql+drbd+heartbeat高性能服务集群配置
- mac svn 服务配置 客户端连接说明
- Ubuntu集群 配置ntp服务
- Nginx 实战(一) 集群环境搭建 Nginx配置文件详细说明
- nginx tomcat集群配置实现无痛重启服务教程python语言版本
- oracle本地服务名配置说明
- 记录Centos6.5下安装vsftp服务及配置文件说明
- Gemfire集群配置服务的一些操作
- mysql服务性能优化—my.cnf配置说明详解(16G内存)