In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "Elasticsearch 5.1.1 how to upgrade 6.7.2". In daily operation, I believe many people have doubts about how to upgrade 6.7.2 in Elasticsearch 5.1.1. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "Elasticsearch 5.1.1 how to upgrade 6.7.2". Next, please follow the editor to study!
2 deal with various problems during the upgrade process 2.1 Update configuration file
Following the startup failure above, I carefully examined the installation process, and several warning during the installation process caught my attention:
Updating / installing... 1:elasticsearch-0:6.7.2-1 warning: / etc/elasticsearch/elasticsearch.yml created as / etc/elasticsearch/elasticsearch.yml.rpmnewwarning: / etc/sysconfig/elasticsearch created as / etc/sysconfig/elasticsearch.rpmnewwarning: / usr/lib/systemd/system/elasticsearch.service created as / usr/lib/systemd/system/elasticsearch.service.rpmnew
Obviously, because the configuration file already exists, the elasticsearch installation process does not overwrite it for you, but stores the new configuration file in the same path ending with .rpmnew. Therefore, we need to merge the configuration files of elasticsearch manually. This belongs to the process of elasticsearch installation, I believe the people who do the upgrade have some knowledge, I will not elaborate.
2.2 repair elasticsearch.keystore
After the configuration file has been modified, do you think it can be started? Naive! A backhand is a mistake:
[root@LPT0268 elasticsearch] # service elasticsearch startStarting elasticsearch (via systemctl): [OK] [yuliangwang@LPT0268 ~] $systemctl status elasticsearch.service ● elasticsearch.service-Elasticsearch Loaded: loaded (/ usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2019-06-28 16:51:37 CST 4s ago Docs: http://www.elastic.co Process: 11905 ExecStart=/usr/share/elasticsearch/bin/elasticsearch-p ${PID_DIR} / elasticsearch.pid-- quiet-Edefault.path.logs=$ {LOG_DIR}-Edefault.path.data=$ {DATA_DIR}-Edefault.path.conf=$ {CONF_DIR} (code=exited, status=1/FAILURE) Process: 13624 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=203/EXEC) Main PID: 11905 (code=exited, status=1/FAILURE)
You can see that the error has not been eliminated, and there are no logs in the / var/log/elasticsearch/ directory. I worked on this problem for a long time, and on a whim, I went to the $ES_HOME/bin directory to directly execute the elasticsearch script, and finally saw the error message:
Jul 01 10:18:06 LPT0268 elasticsearch [1345]: Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: java.io.EOFException: SimpleFSIndexInput (path= "/ etc/ela...rch.keystore") Jul 01 10:18:06 LPT0268 elasticsearch [1345]: Likely root cause: java.io.EOFException: read past EOF: SimpleFSIndexInput (path= "/ etc/elasticsearch/elasticsearch.keystore") Jul 01 10:18:06 LPT0268 elasticsearch [1345]: at org.apache.lucene.store.BufferedIndexInput.refill ( BufferedIndexInput.java:336) Jul 01 10:18:06 LPT0268 elasticsearch [1345]: at org.apache.lucene.store.BufferedIndexInput.readByte (BufferedIndexInput.java:54) Jul 01 10:18:06 LPT0268 elasticsearch [1345]: at org.apache.lucene.store.BufferedChecksumIndexInput.readByte (BufferedChecksumIndexInput.java:41) Jul 01 10:18:06 LPT0268 elasticsearch [1345]: at org.apache.lucene.store.DataInput.readInt (DataInput.java:101) Jul 01 10:18:06 LPT0268 elasticsearch [1345]: at org.apache. Lucene.codecs.CodecUtil.checkHeader (CodecUtil.java:194) Jul 01 10:18:06 LPT0268 systemd [1]: elasticsearch.service: main process exited Code=exited, status=1/FAILUREJul 01 10:18:06 LPT0268 systemd [1]: Unit elasticsearch.service entered failed state.Jul 01 10:18:06 LPT0268 systemd [1]: elasticsearch.service failed.Hint: Some lines were ellipsized, use-l to show in full.
It turned out that it was caused by the elasticsearch.keystore product we just created. By consulting the document, we found that the elasticsearch.keystore file could not be created manually, because it is a file related to the KeyStore that comes with ES, so we must use the command to create it.
Sudo bin/elasticsearch-keystore create
Official statement:
Https://www.elastic.co/guide/en/elasticsearch/reference/current/secure-settings.html
Official documentation can also explain why our modification of the configuration file did not affect the error report. Because elasticsearch itself loads elasticsearch.keystore first, then loads the configuration file.
2.3 repair bootstrap.memory_lock
Start ES again, but still report an error (heart breakdown, recovered after a weekend of repair):
[yuliangwang@LPT0268 bin] $systemctl status elasticsearch ● elasticsearch.service-Elasticsearch Loaded: loaded (/ usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled) Drop-In: / etc/systemd/system/elasticsearch.service.d └─ override.conf Active: failed (Result: exit-code) since Mon 2019-07-01 11:04:32 CST 20s ago Docs: http://www.elastic.co Process: 4898 ExecStart=/usr/share/elasticsearch/bin/elasticsearch-p ${PID_DIR} / elasticsearch.pid-- quiet (code=exited, status=78) Main PID: 4898 (code=exited, status=78)
The good news is that we finally have log, open / var/log/elasticsearch/, to extract the problematic message:
[2019-07-01T10:54:12406] [WARN] [o.e.b.JNANatives] [unknown] Unable to lock JVM Memory: error=12, reason=Cannot allocate memory [2019-07-01T10:54:12409] [WARN] [o.e.b.JNANatives] [unknown] This can result in part of the JVM being swapped out. [2019-07-01T10:54:12409] [WARN] [o.e.b.JNANatives] [unknown] Increase RLIMIT_MEMLOCK, soft limit: 65536 Hard limit: 65536 [2019-07-01T10:54:12409] [WARN] [o.e.b.JNANatives] [unknown] These can be adjusted by modifying / etc/security/limits.conf, for example: # allow user 'elasticsearch' mlockall elasticsearch soft memlock unlimited elasticsearch hard memlock unlimited [2019-07-01T10:54:12409] [WARN] [o.e.b.JNANatives] [unknown] If you are logged in interactively You will have to re-login for the new limits to take effect. [2019-07-01T10:54:21051] [ERROR] [o.e.b.Bootstrap] [G1bC4Hf] node validation exception [1] bootstrap checks failed [1]: memory locking requested for elasticsearch process but memory is not locked
You can see that locking memory has something to do with it. This is because we added a configuration to turn off swap in the configuration:
Bootstrap.memory_lock: true
Turning off swap prevents OS from swapping memory to disk, which, according to official documentation, prevents slow GC:
Https://www.elastic.co/guide/en/elasticsearch/reference/6.7/setup-configuration-memory.html
Configure / etc/systemd/system/elasticsearch.service.d/override.conf according to the documentation, and set the value to:
[Service] LimitMEMLOCK=infinity
Then refresh
Sudo systemctl daemon-reload
Finally succeeded after starting it again:
[root@LPT0268 elasticsearch] # sudo service elasticsearch restartRestarting elasticsearch (via systemctl): [OK] [root@LPT0268 elasticsearch] # systemctl status elasticsearch ● elasticsearch.service-Elasticsearch Loaded: loaded (/ usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled) Drop-In: / etc/systemd/system/elasticsearch.service.d └─ override.conf Active: active (running) since Mon 2019-07-01 13:57:51 CST 14s ago Docs: http://www.elastic.co Main PID: 15294 (java) CGroup: / system.slice/elasticsearch.service ├─ 15294 / bin/java-Xms1g-Xmx1g-XX:+UseConcMarkSweepGC-XX:CMSInitiatingOccupancyFraction=75-XX:+UseCMSInitiatingOccupancyOnly-Des.networkaddress.cache.ttl=60-Des.networkaddress.cache.negat... └─ 15375 / usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller
The returned version of port 9200 is 6.7.2:
{"name": "G1bC4Hf", "cluster_name": "psylocke-fws-oy", "cluster_uuid": "PDI23Ik4TAGx10mMocqGLQ", "version": {"number": "6.7.2", "build_flavor": "default", "build_type": "rpm", "build_hash": "56c6e48", "build_date": "2019-04-29T09:05:50.290371Z" "build_snapshot": false, "lucene_version": "7.7.0", "minimum_wire_compatibility_version": "5.6.0", "minimum_index_compatibility_version": "5.0.0"}, "tagline": "You Know, for Search"} 3 restore cluster
After upgrading each machine in the cluster in turn, start the cluster and check the cluster status through GET _ cat/health. At this point, the cluster status is red. Through GET _ cat/shards, you can see that the master shard has already been started, but the slave shard is still invalid. Restore the cluster routing with the following command
PUT _ cluster/settings {"transient": {"cluster.routing.allocation.enable": "all"}}
You can see that the cluster changes to yellow and starts to recover:
1561970784 08:46:24 psylocke-fws-oy yellow 1 1 17 17 00 150-53.1% here, the study on "Elasticsearch 5.1.1 how to upgrade 6.7.2" is over. I hope I can solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.