es6.3集群安装方法(elasticsearch)
(一)下载安装包
elasticsearch-6.3.0.tar.gz
elasticsearch-analysis-ik-6.3.0.zip
下载地址:
https://www.elastic.co/cn/downloads/past-releases

https://github.com/medcl/elasticsearch-analysis-ik/tags?after=v6.3.0

(二)创建非root用户es
es 不能在root用户下启动,所有需要新创建一个用户es
useradd es
passwd es
1
如果是已经建好的目录权限是root
需要改目录及子目录的权限
chown es.es -R /usr/cwgis/app/es
chown es.es -R /usr/cwgis/data/es
(三)安装es
安装到目录/usr/cwgis/app/es
数据和日志目录
/usr/cwgis/data/es/esdata
/usr/cwgis/data/es/eslog
解压文件
tar -zxvf elasticsearch-6.3.0.tar.gz
mv elasticsearch-6.3.0 es
配置参数文件/es/config/elasticsearch.yml
主要添加如下内容:

cluster.name: es_sapsoft
node.name: node111     
#不同机子改为不同机器名或IP,如node112,node123,
#注意:冒号后面有一个空格
path.data: /usr/cwgis/data/es/esdata
path.logs: /usr/cwgis/data/es/eslog
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: node111     #不同机子改为不同机器名或IP
http.port: 9200
#9300为集群服务的端口
discovery.zen.ping.unicast.hosts: [\"node111\", \"node112\", \"node113\", \"node115\", \"node116\", \"node117\", \"node118\", \"node119\", \"node120\", \"node121\", \"node122\", \"node123\"]
#为了避免stop,集群节点数最少为 半数+1
discovery.zen.minimum_master_nodes: 7

(四)修改centos中的系统文件内容:
vi /etc/security/limits.conf 修改内容如下:

* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096

分发配置文件cc.sh /etc/security/limits.conf /etc/security/limits.conf es
vi /etc/security/limits.d/20-nproc.conf 修改内容如下:

* soft nproc 2048

分发配置文件cc.sh /etc/security/limits.d/20-nproc.conf /etc/security/limits.d/20-nproc.conf es
vi /etc/sysctl.conf 修改内容如下:

vm.max_map_count=655360

分发配置文件cc.sh /etc/sysctl.conf /etc/sysctl.conf es
并执行命令sysctl -p
runCmd.sh “sysctl -p” es

(五)启动es集群
后台启动命令:/es/bin/elasticsearch -d

runCmd.sh \"/usr/cwgis/app/es/bin/elasticsearch -d\" es

(六)显示查看web页面
http://node111:9200/_cat/

=^.^=
/_cat/allocation
/_cat/shards
/_cat/shards/{index}
/_cat/master
/_cat/nodes
/_cat/tasks
/_cat/indices
/_cat/indices/{index}
/_cat/segments
/_cat/segments/{index}
/_cat/count
/_cat/count/{index}
/_cat/recovery
/_cat/recovery/{index}
/_cat/health
/_cat/pending_tasks
/_cat/aliases
/_cat/aliases/{alias}
/_cat/thread_pool
/_cat/thread_pool/{thread_pools}
/_cat/plugins
/_cat/fielddata
/_cat/fielddata/{fields}
/_cat/nodeattrs
/_cat/repositories
/_cat/snapshots/{repository}
/_cat/templates

查看所有节点地址:http://node111:9200/_cat/nodes

192.168.30.112 38 43 0 0.00 0.01 0.05 mdi - node112
192.168.30.116 34 26 0 0.00 0.01 0.05 mdi - node116
192.168.30.117 22 34 0 0.00 0.01 0.05 mdi * node117
192.168.30.120 35 27 0 0.00 0.01 0.05 mdi - node120
192.168.30.118 34 29 0 0.00 0.01 0.05 mdi - node118
192.168.30.111 22 54 0 0.00 0.02 0.05 mdi - node111
192.168.30.119 35 28 0 0.04 0.09 0.07 mdi - node119
192.168.30.123 31 30 0 0.01 0.04 0.05 mdi - node123
192.168.30.113 29 40 0 0.00 0.01 0.05 mdi - node113
192.168.30.121 31 30 0 0.00 0.01 0.05 mdi - node121
192.168.30.115 37 28 0 0.00 0.01 0.05 mdi - node115
192.168.30.122 31 27 0 0.05 0.10 0.08 mdi - node122
  • node117表示当前活动主master节点
    —the—end—
收藏 打印