elasticsearch 安装历程

elasticsearch 安装历程

elasticsearch 安装:
下载页:https://www.elastic.co/downloads/elasticsearch#ga-release
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.5.4.tar.gz
tar -zxvf elasticsearch-6.5.4.tar.gz

cd config
vim elasticsearch.yml
写入 (记得要有空格)
xpack.ml.enabled: false
network.host: 0.0.0.0
http.port: 8301
#memory
bootstrap.memory_lock: false
bootstrap.system_call_filter: false

不能用root启动 把权限赋给es用户
chown -R es:es /usr/local/elasticsearch/
启动:./bin/elasticsearch

echo "vm.max_map_count = 282144" >> /etc/sysctl.conf

修改系统配置:vi /etc/sysctl.conf
查看配置:sysctl -p

注意 要以root身份执行下面的脚本,执行后要重新登录普通账户启动ES

#!/bin/bash
echo "* soft    nofile  65536" >> /etc/security/limits.conf
echo "* hard    nofile  65536" >> /etc/security/limits.conf
echo "* soft memlock unlimited" >> /etc/security/limits.conf
echo "* hard memlock unlimited" >> /etc/security/limits.conf
echo "vm.max_map_count = 262144" >> /etc/sysctl.conf
sysctl -p
ulimit -l unlimited

如果报错
OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
在config/jvm.options 需要修改
添加
-XX:-AssumeMP
这些参数要比系统的内存要小
-Xms
-Xmx
--------------------
集群配置

cluster.name: xiaofeng
node.name: xiaofeng_1   //节点名
node.master: true      //主服务


es2配置

xpack.ml.enabled: false
network.host: 0.0.0.0
http.port: 8380
#memory
bootstrap.memory_lock: false
bootstrap.system_call_filter: false

http.cors.enabled: true
http.cors.allow-origin: "*"

cluster.name: xiaofeng
node.name: xiaofeng_2
node.master: false
discovery.zen.ping.unicast.hosts: ["127.0.0.1"]  //写上主机的ip

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值