elasticsearch 6.1集群的安装

安装的需求

  jdk版本:open-jdk.1.8

具体安装

1.创建一个用户(注意es不能用root用户启动,所以这一步是必须的)

groupadd elastic
useradd elastic -g elastic
chown -R elastic:elastic /opt/elasticsearch/

2.修改系统配置

1.解决:(max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144])
 
vim /etc/sysctl.conf
vm.max_map_count=262144
sysctl -p  #生效
 
2.解决 :(max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536] max number of threads [1024] for user [lishang] likely too low, increase to at least [2048])
[root@controller config]# vim /etc/security/limits.conf
*  hard nofile 65536
*  soft nofile 65536
su - elastic #切换用户生效limits.conf的配置

3.修改配置文件

cluster.name: es-hyb
node.name: node-35-113
path.data: /path/to/data
path.logs: /path/to/logs
network.host: 0.0.0.0	#设置绑定的ip地址,可以是ipv4或ipv6的,默认为本机,想让。
network.publish_host: 10.81.3*.*** #设置其它节点和该节点交互的ip地址,如果不设置它会自动判断,值必须是个真实的ip地址。
http.port: 9200    #端口
http.cors.enabled: true         
http.cors.allow-origin: "*"			#允许跨越访问
script.allowed_types: inline		#支持inline脚本
script.allowed_contexts: search, update  #inline脚本支持的范围
node.master: true     #是否可以作为主节点
node.data: true		  #是否可以作为数据节点
discovery.zen.ping.unicast.hosts: ["10.81.3*.**","10.81.3*.***"] #设置集群中master节点的初始列表,可以通过这些节点来自动发现新加入集群的节点。
discovery.zen.minimum_master_nodes: 2 #设置这个参数来保证集群中的节点可以知道其它N个有master资格的节点。默认为1,对于大的集群来说,可以设置大一点的值(2-4)



4.启动和停止

按上面的配置,在其他机器上安装上es,一一启动即可

./elasticsearch -d
#或者
nohup ./elasticsearch &

停止的话,可以直接kill 

启动的时候注意账号的切换



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值