elasticsearch 将Elastic Search从7降到6?

6rqinv9w  于 2023-11-17  发布在  ElasticSearch
关注(0)|答案(3)|浏览(172)

我正在尝试将Elastic Search从7降级到6,因为我使用的应用程序只能在6上运行。
当我安装6时,由于某种原因,我被提升到7:

{
  "name" : "activecollab-v6",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "D7qs_zqTTX6Rv8AiE_ioqw",
  "version" : {
    "number" : "7.1.0",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "606a173",
    "build_date" : "2019-05-16T00:43:15.323135Z",
    "build_snapshot" : false,
    "lucene_version" : "8.0.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

字符串
我如何确保我被降级?下面是我的安装配方,下面是配方报告,显示ElasticSearch也安装了。

# Install Elastic Search

echo ">> Installing Elastic GPG Key"
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

echo ">> Install apt-transport-https"
apt install apt-transport-https

echo ">> Adding deb package"
echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list

echo ">> Updating apt"
apt update

echo ">> Installing Java and Elastic Search"
apt -y install default-jre elasticsearch

echo ">> Java Installed"
echo ">> Elastic Search Installed"

echo ">> Scheduling Elasticsearch"
/bin/systemctl daemon-reload
/bin/systemctl enable elasticsearch.service

echo ">> Starting Elasticsearch"
systemctl start elasticsearch.service

echo ">> Running on port 9200. Make sure to add a firewall rule if you need external access."
echo ">> You can check the status by running 'curl 'http://localhost:9200'. Note: may take a few seconds before elasticsearch is fully started."

配方报告

>> Installing Elastic GPG Key
Warning: apt-key output should not be parsed (stdout is not a terminal)
OK
>> Install apt-transport-https

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
apt-transport-https is already the newest version (1.6.10).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
>> Adding deb package
deb https://artifacts.elastic.co/packages/6.x/apt stable main
>> Updating apt

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Get:1 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu bionic InRelease [15.4 kB]
Get:2 http://mirrors.digitalocean.com/ubuntu bionic InRelease [242 kB]
Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:5 http://ppa.launchpad.net/nginx/development/ubuntu bionic InRelease [15.4 kB]
Get:6 http://ppa.launchpad.net/ondrej/apache2/ubuntu bionic InRelease [20.7 kB]
Get:7 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease [20.8 kB]
Get:8 http://ppa.launchpad.net/webupd8team/java/ubuntu bionic InRelease [15.4 kB]
Get:9 https://deb.nodesource.com/node_10.x bionic InRelease [4584 B]
Hit:10 https://repos.sonar.digitalocean.com/apt main InRelease
Get:11 http://mirrors.digitalocean.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:12 http://mirrors.digitalocean.com/ubuntu bionic-backports InRelease [74.6 kB]
Ign:13 https://artifacts.elastic.co/packages/6.x/apt stable InRelease
Get:14 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu bionic/main amd64 Packages [1004 B]
Get:15 http://ppa.launchpad.net/chris-lea/redis-server/ubuntu bionic/main Translation-en [584 B]
Ign:16 https://artifacts.elastic.co/packages/7.x/apt stable InRelease
Get:17 https://artifacts.elastic.co/packages/6.x/apt stable Release [5116 B]
Get:18 https://artifacts.elastic.co/packages/7.x/apt stable Release [5116 B]
Get:19 https://artifacts.elastic.co/packages/6.x/apt stable Release.gpg [473 B]
Get:20 https://artifacts.elastic.co/packages/7.x/apt stable Release.gpg [473 B]
Get:21 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [349 kB]
Get:22 http://security.ubuntu.com/ubuntu bionic-security/main Translation-en [125 kB]
Get:23 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [4296 B]
Get:24 http://security.ubuntu.com/ubuntu bionic-security/restricted Translation-en [2192 B]
Get:25 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [245 kB]
Get:26 http://security.ubuntu.com/ubuntu bionic-security/universe Translation-en [140 kB]
Get:27 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [4004 B]
Get:28 http://security.ubuntu.com/ubuntu bionic-security/multiverse Translation-en [2060 B]
Get:29 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [8570 kB]
Get:30 http://archive.ubuntu.com/ubuntu bionic/universe Translation-en [4941 kB]
Get:31 http://ppa.launchpad.net/nginx/development/ubuntu bionic/main amd64 Packages [4264 B]
Get:32 http://ppa.launchpad.net/nginx/development/ubuntu bionic/main Translation-en [4328 B]
Get:33 http://ppa.launchpad.net/ondrej/apache2/ubuntu bionic/main amd64 Packages [8528 B]
Get:34 http://ppa.launchpad.net/ondrej/apache2/ubuntu bionic/main Translation-en [4052 B]
Get:35 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 Packages [45.1 kB]
Get:36 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main Translation-en [22.1 kB]
Get:37 http://mirrors.digitalocean.com/ubuntu bionic/main amd64 Packages [1019 kB]
Get:38 http://mirrors.digitalocean.com/ubuntu bionic/main Translation-en [516 kB]
Get:39 http://mirrors.digitalocean.com/ubuntu bionic/restricted amd64 Packages [9184 B]
Get:40 http://mirrors.digitalocean.com/ubuntu bionic/restricted Translation-en [3584 B]
Get:41 http://mirrors.digitalocean.com/ubuntu bionic/universe amd64 Packages [8570 kB]
Get:42 https://deb.nodesource.com/node_10.x bionic/main amd64 Packages [767 B]
Get:43 http://mirrors.digitalocean.com/ubuntu bionic/universe Translation-en [4941 kB]
Get:44 http://mirrors.digitalocean.com/ubuntu bionic/multiverse amd64 Packages [151 kB]
Get:45 http://mirrors.digitalocean.com/ubuntu bionic/multiverse Translation-en [108 kB]
Get:46 http://mirrors.digitalocean.com/ubuntu bionic-updates/main amd64 Packages [618 kB]
Get:47 http://mirrors.digitalocean.com/ubuntu bionic-updates/main Translation-en [229 kB]
Get:48 http://mirrors.digitalocean.com/ubuntu bionic-updates/restricted amd64 Packages [6996 B]
Get:49 http://mirrors.digitalocean.com/ubuntu bionic-updates/restricted Translation-en [3076 B]
Get:50 http://mirrors.digitalocean.com/ubuntu bionic-updates/universe amd64 Packages [937 kB]
Get:51 http://mirrors.digitalocean.com/ubuntu bionic-updates/universe Translation-en [274 kB]
Get:52 http://mirrors.digitalocean.com/ubuntu bionic-updates/multiverse amd64 Packages [6644 B]
Get:53 http://mirrors.digitalocean.com/ubuntu bionic-updates/multiverse Translation-en [3556 B]
Get:54 http://mirrors.digitalocean.com/ubuntu bionic-backports/main amd64 Packages [1024 B]
Get:55 http://mirrors.digitalocean.com/ubuntu bionic-backports/main Translation-en [448 B]
Get:56 http://mirrors.digitalocean.com/ubuntu bionic-backports/universe amd64 Packages [3496 B]
Get:57 http://mirrors.digitalocean.com/ubuntu bionic-backports/universe Translation-en [1604 B]
Get:58 https://artifacts.elastic.co/packages/6.x/apt stable/main amd64 Packages [49.1 kB]
Get:59 https://artifacts.elastic.co/packages/7.x/apt stable/main amd64 Packages [6534 B]
Fetched 32.8 MB in 8s (4196 kB/s)
Reading package lists...
Building dependency tree...
Reading state information...
7 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:3
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:3
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:3
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:3
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:3
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:4
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:4
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:4
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:4
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:4
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:3
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:3
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:3
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:3
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:3
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:4
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:4
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:4
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:4
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:4
>> Installing Java and Elastic Search

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
default-jre is already the newest version (2:1.11-68ubuntu1~18.04.1).
The following NEW packages will be installed:
  elasticsearch
0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded.
Need to get 347 MB of archives.
After this operation, 572 MB of additional disk space will be used.
Get:1 https://artifacts.elastic.co/packages/7.x/apt stable/main amd64 elasticsearch amd64 7.1.0 [347 MB]
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin: 
Fetched 347 MB in 6s (57.1 MB/s)
Selecting previously unselected package elasticsearch.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 91269 files and directories currently installed.)
Preparing to unpack .../elasticsearch_7.1.0_amd64.deb ...
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Unpacking elasticsearch (7.1.0) ...
Processing triggers for ureadahead (0.100.0-21) ...
Setting up elasticsearch (7.1.0) ...
Created elasticsearch keystore in /etc/elasticsearch
Processing triggers for systemd (237-3ubuntu10.21) ...
Processing triggers for ureadahead (0.100.0-21) ...
>> Java Installed
>> Elastic Search Installed
>> Scheduling Elasticsearch
Synchronizing state of elasticsearch.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable elasticsearch
Created symlink /etc/systemd/system/multi-user.target.wants/elasticsearch.service → /usr/lib/systemd/system/elasticsearch.service.
>> Starting Elasticsearch
>> Running on port 9200. Make sure to add a firewall rule if you need external access.
>> You can check the status by running 'curl 'http://localhost:9200'. Note: may take a few seconds before elasticsearch is fully started.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

wd2eg0qa

wd2eg0qa1#

1.没有降级。重新安装并重新开始。

  1. DEB仓库看起来是正确的。你一直都是这样吗?因为这不能让你得到7.x版本。
    更新:
    我可以在输出中看到Get:59 https://artifacts.elastic.co/packages/7.x/apt stable/main amd64 Packages [6534 B]行,所以你已经添加了6.x和7.x版本库。删除7.x repo(/etc/apt/sources.list.d/elastic-7.x.list),清除,然后重新安装。
    或者,你可以清除elasticsearch并指定要安装的版本:sudo apt-get install elasticsearch=6.8.0。我认为这是你可以选择的版本号,但你可以验证apt-cache policy elasticsearch的可用版本。
llmtgqce

llmtgqce2#

我在同样的位置降级elasticsearch从7到6而不丢失数据。我做的简单技巧是,删除现有的elasticsearch,并安装一个新的。它为我工作。我想给予你降级的步骤。我使用的是ubuntu服务器。因此,
1.停止正在运行的服务器。sudo service elasticsearch stop
1.删除ElasticSearch:sudo apt-get remove elasticsearch
1.安装ElasticSearch6.x版
安装参考链接:Install elasticsearch in ubuntu

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
sudo apt-get update && sudo apt-get install elasticsearch

字符串
Elasticsearch可能会自动启动。您可以检查状态:sudo service elasticsearch status。如果它显示失败,您可以使用:sudo service elasticsearch restartsudo systemctl restart elasticsearch重新启动它。它应该会重新启动elasticsearch服务器。
完了
警告!注意!
我不能保证数据会在那里。因此,请确保在执行此步骤之前备份您的数据。是的,我确实没有丢失数据。

xbp102n0

xbp102n03#

要升级/降级ElasticSearch,您可以使用Aptitude

# Available Versions
sudo apt policy elasticsearch 
 
# Example 8.8.2
sudo aptitude install elasticsearch=8.8.2
 
# At Downgrade there can be problems with existing nodes
# then cleanup the following path
# path.data: /var/lib/elasticsearch

字符串

相关问题