A quick start guild of ELK 7.3.2, including package installation and simple test.
好吧,其实是发现之前的快速搭建ELK7.2有些坑,决定还是再来一次。
安装版相比直接解压版还是有些好处的,最起码安装完就是Service,省却打命令行的许多麻烦。
https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-elastic-stack.html
All other installations are similar, you can find the services list as below.
sudo systemctl start elasticsearch.service sudo systemctl start kibana.service sudo systemctl start logstash.service sudo systemctl start filebeat.service sudo systemctl start heartbeat-elastic.serviceThe last configure change is for bootstrap error below.
sudo tail /var/log/elasticsearch/elasticsearch.log [2019-10-10T10:06:24,340][ERROR][o.e.b.Bootstrap ] [appserver01] node validation exception [1] bootstrap checks failed [1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured没有遇到7.2解压版里的vm.max_map_count is too low的问题。
粗略看一下,它是放到启动的script里了。
sudo view /etc/init.d/elasticsearch MAX_OPEN_FILES=65535 MAX_MAP_COUNT=262144 sysctl -q -w vm.max_map_count=$MAX_MAP_COUNTNow Kibana can be accessed from another host browser http://192.168.1.88:5601/
开始也尝试装到指定目录,但发现装完后Service里的路径并没有改过来,说明还需要些手动工作,还是不折腾了。
$ sudo rpm -ivh --prefix=/opt/elk elasticsearch-7.3.2-x86_64.rpm warning: elasticsearch-7.3.2-x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID d88e42b4: NOKEY Preparing... ################################# [100%] Creating elasticsearch group... OK Creating elasticsearch user... OK Updating / installing... 1:elasticsearch-0:7.3.2-1 ################################# [100%] ### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd sudo systemctl daemon-reload sudo systemctl enable elasticsearch.service ### You can start elasticsearch service by executing sudo systemctl start elasticsearch.service /var/tmp/rpm-tmp.JyvHeM: line 8: /usr/share/elasticsearch/bin/elasticsearch-keystore: No such file or directory chown: cannot access ‘/etc/elasticsearch/elasticsearch.keystore’: No such file or directory chmod: cannot access ‘/etc/elasticsearch/elasticsearch.keystore’: No such file or directory md5sum: /etc/elasticsearch/elasticsearch.keystore: No such file or directory warning: %posttrans(elasticsearch-0:7.3.2-1.x86_64) scriptlet failed, exit status 1因为机器里原本有旧版本的ELK,重新安装Elasticsearch后发现启动不了。
网上说已经有一个在运行,但我这里并没有发现。
最后再一次重装解决了,重装之前把相关路径下的所有文件都删了一遍。
Failed to startup Elasticsearch with below error.
[2019-09-23T16:41:39,751][ERROR][o.e.b.Bootstrap ] [appserver01] Exception java.lang.IllegalStateException: failed to obtain node locks, tried [[/var/lib/elasticsearch]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?Not work even after nodes configure is updated as below.
node.max_local_storage_nodes: 2The issue was solved after removing all related folders, and we also added CPU and memory (reboot) during the period.
Maybe the files were not cleaned up in the related folders when uninstalled old version.
$ sudo rpm -ql elasticsearch>elasticsearch_pkg.log $ sudo rpm -ev elasticsearch Preparing packages... Stopping elasticsearch service... OK elasticsearch-0:5.4.0-1.noarch Deleting log directory... OK $ sudo rpm -ql elasticsearch package elasticsearch is not installed find / -iname "elasticsearch"Remove all old version files found.
sudo rm -rf /usr/share/elasticsearch sudo rm -rf /etc/elasticsearch sudo rm -rf /var/log/elasticsearch sudo rm -rf /var/lib/elasticsearch