Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to upgrade from Elasticsearch 5.1.1 to 6.7.2

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "Elasticsearch 5.1.1 how to upgrade to 6.7.2", the content of the article is simple and clear, easy to learn and understand, now please follow the editor's ideas slowly in depth, together to study and learn "Elasticsearch 5.1.1 how to upgrade to 6.7.2" bar!

1 upgrade process

Since our ES version is lower than 5.6, we need to upgrade through full cluster restart. The upgrade process is mainly based on the official documentation:

Https://www.elastic.co/guide/en/elasticsearch/reference/6.0/setup-upgrade.html

1.1 Disable shard allocation. Turn off shard chip redistribution.

Because the shard shard of es contains master-slave shards, and master-slave shards are generally in different nodes. If a node dies (of course, we shut it down actively during the upgrade process), es will redistribute fragments because it is all network IO, which is slow to explode. So first of all, we have to turn off shard chip redistribution.

The method is simple:

PUT _ cluster/settings {"persistent": {"cluster.routing.allocation.enable": "none"}} 1.2 Stop indexing and perform a synced flush.

Brush the shard film:

POST _ flush/synced1.3 Shutdown all nodes.

To shut down the Elasticsearch service, please note that you need one server and one gateway:

Sudo systemctl stop elasticsearch.service1.4 upgrade Elasticsearch version

Note that there are a lot of tricks in this step. I record one by one.

First of all, refer to the official website documentation.

Https://www.elastic.co/guide/en/elasticsearch/reference/6.0/rpm.html

Because our server cannot connect to Internet, we need to download the following files, especially elasticsearch-6.7.2.rpm.sha512 GPG-KEY-elasticsearch, which must be necessary.

GPG-KEY-elasticsearch can be downloaded by downloading

Wget https://artifacts.elastic.co/GPG-KEY-elasticsearch

The following files are included when the download is complete:

$lselasticsearch-6.7.2.rpm elasticsearch-6.7.2.rpm.sha512 GPG-KEY-elasticsearch kibana-6.7.2-x86_64.rpm

Then introduce the public key of es, because we are local and need to change the path:

Rpm-- import. / GPG-KEY-elasticsearch

After the introduction of the public key, you need to verify the integrity of the rpm package. Here, sha512 is used. If you do not install the relevant tools, you will get an error. You need to install the sha verification tool first:

Sudo yum install perl-Digest-SHA

Check:

Shasum-a512-c elasticsearch-6.7.2.rpm.sha512

Then the first pit comes and install it according to the tutorial on the official website.

Sudo rpm-install elasticsearch-6.7.2.rpm

File conflicts report errors because older versions of es have already been installed.

File / etc/init.d/elasticsearch from install of elasticsearch-0:6.7.2-1.noarch conflicts with file from package elasticsearch-0:5.1.1-1.noarch file / etc/sysconfig/elasticsearch from install of elasticsearch-0:6.7.2-1.noarch conflicts with file from package elasticsearch-0:5.1.1-1.noarch file / usr/share/elasticsearch/bin/elasticsearch from install of elasticsearch-0:6.7.2-1.noarch conflicts with file From package elasticsearch-0:5.1.1-1.noarchs...

And then we use it to install

Sudo rpm-Uvh elasticsearch-6.7.2.rpm

Half of the installation and reported an error, you can see that elasticsearch.keystore does not exist, I created an elasticsearch.keystore, the installation can be successful. Note that this is a big pit, which will be detailed later.

Preparing... # # [100%] 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## # [50%] Cleaning up / removing... 2:elasticsearch-0:5.1.1-1 warning: / etc/elasticsearch/scripts saved as / etc/elasticsearch/scripts.rpmsave## [100%] ES_PATH_CONF must be set to the configuration pathchown: cannot access'/ etc/elasticsearch/elasticsearch.keystore': No such file or directorychmod: cannot access'/ etc/elasticsearch/elasticsearch.keystore': No Such file or directorymd5sum: / etc/elasticsearch/elasticsearch.keystore: No such file or directorywarning:% posttrans (elasticsearch-0:6.7.2-1.noarch) scriptlet failed Exit status 1

Once created, the installation is successful:

Preparing... # # [100%] package elasticsearch-0:6.7.2-1.noarch is already installed

After the installation is successful, it is time to start the elasticsearch cluster:

Sudo service elasticsearch start

Unfortunately, the startup failed, and port 9200 of elasticsearch is not responding. Check the startup status and you can see Active: failed.

[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:50:18 CST 24s 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: 13440 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=203/EXEC) Main PID: 11905 (code=exited Status=1/FAILURE) Thank you for your reading The above is the content of "how to upgrade Elasticsearch 5.1.1 to 6.7.2". After the study of this article, I believe you have a deeper understanding of how to upgrade Elasticsearch 5.1.1 to 6.7.2, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report