简易elasticsearch服务器搭建-创新互联
1:下载和解压:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.2.tar.gz
2:配置config/elasticsearch.yml
network.host: 10.99.32.16
http.port: 9200
path.logs: /root/elasticsearch/log
path.data: /root/elasticsearch/data
node.name: node-1
cluster.name: mycluster
discovery.zen.ping.unicast.hosts: ["10.99.32.16", "10.99.32.17", "10.99.32.18"]
discovery.zen.minimum_master_nodes: 2
bootstrap.memory_lock: true
3:配置config/jvm.options
4:配置一些系统内核参数:
can not run elasticsearch as root:
不能使用root用户进行操作,需要创建一个用户,并把原来的目录的拥有者更改为该用户
adduser myuser
passwd myuser
chown -R myuser /mypath
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
修改/etc/security/limits.conf
添加:elastic hard nofile 65536
max file size [67107840] for user [elastic] is too low, increase to [unlimited]
修改/etc/security/limits.conf
elastic soft fsize unlimited
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决:sysctl -w vm.max_map_count=262144
5:运行:
bin/elasticsearch
后台运行:bin/elasticsearch -d -p pidFile
会生成一个pidFile文件,记录pid
随系统启动:
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
名称栏目:简易elasticsearch服务器搭建-创新互联
本文来源:http://azwzsj.com/article/cssipg.html