centostwo
地址:
https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html
添加yum源
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
添加一下文件填充内容
vi /etc/zypp/repos.d/elasticsearch.repo
[elasticsearch]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md
然后
sudo yum install --enablerepo=elasticsearch elasticsearch
然后
vi /etc/elasticsearch/elasticsearch.yml
// 修改集群名称 如果多台集群 名称必须相同
cluster.name: myelasticsearch
集群节点名称
node.name: node-1
// 锁住内存 就不会被交换到。。
bootstrap.memory_lock: true
//监听 ip
network.host: 0.0.0.0
端口打开
开启
systemctl start elasticsearch / 命令启动es
sudo chkconfig --add elasticsearch 设置自动启动es
sudo -i service elasticsearch start / 命令启动es
sudo -i service elasticsearch stop / stop 关闭es
如果报错
则 通过
less 集群名称.log 看看报什么错 然后解决
日志 在自己配置的目录下 直接查看集群log 即可。
报错 如下 然后解决如下
软件:java-1.8、elasticsearch-5.6.16-1.noarch
错误信息:
[2019-11-21T00:29:51,557][ERROR][o.e.b.Bootstrap ] [elk-1] node validation exception
[1] bootstrap checks failed
[1]: memory locking requested for elasticsearch process but memory is not locked
解决方法一(关闭bootstrap.memory_lock:,会影响性能):
# vim /etc/elasticsearch/elasticsearch.yml // 设置成false就正常运行了。
bootstrap.memory_lock: false
解决方法二(开启bootstrap.memory_lock:):
1. 修改文件/etc/elasticsearch/elasticsearch.yml,上面那个报错就是开启后产生的,如果开启还要修改其它系统配置文件
bootstrap.memory_lock: true
2. 修改文件/etc/security/limits.conf,最后添加以下内容。
* soft nofile 65536
* hard nofile 65536
* soft nproc 32000
* hard nproc 32000
* hard memlock unlimited
* soft memlock unlimited
3. 修改文件 /etc/systemd/system.conf ,分别修改以下内容。
DefaultLimitNOFILE=65536
DefaultLimitNPROC=32000
DefaultLimitMEMLOCK=infinity
改好后重启下系统。再启动elasticsearch就没报错了 。
----------------------
错误信息:
11月 22 18:26:13 filebeat.sh.com elasticsearch[9775]: ERROR: [1] bootstrap checks failed
11月 22 18:26:13 filebeat.sh.com elasticsearch[9775]: [1]: the default discovery settings are unsuitable for production use;...gured
解决方法:打开默认配置即可
# vim /etc/elasticsearch/elasticsearch.yml
discovery.seed_hosts: ["host1", "host2"]
cluster.initial_master_nodes: ["node-1", "node-2"]
# systemctl restart elasticsearch
————————————————
版权声明:本文为CSDN博主「璐程风」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/cbuy888/article/details/103166008