CI: deploy OpenSearch 1.x instead of Elasticsearch

Change DevStack plugin to deploy OpenSearch 1.x instead of Elasticsearch
when using the elasticsearch storage driver. This is in preparation for
supporting OpenSearch instead of Elasticsearch. Note that CloudKitty
does not work with OpenSearch 2.x yet, likely due to the removal of
mapping types [1].

[1] https://opensearch.org/docs/2.0/breaking-changes/#remove-mapping-types-parameter

Change-Id: I572cba384a9a16ee2bbfe07b5c316ed5abbb5681
This commit is contained in:
Pierre Riteau 2022-12-06 10:33:04 +01:00
parent addb4d6aa8
commit 5fdb65b71a

View File

@ -301,27 +301,20 @@ function install_influx {
sudo systemctl start influxdb || sudo systemctl restart influxdb sudo systemctl start influxdb || sudo systemctl restart influxdb
} }
function install_elasticsearch_ubuntu { function install_opensearch {
sudo apt install -qy openjdk-8-jre OPENSEARCH_HOME=/usr/share/opensearch
local elasticsearch_file=$(get_extra_file https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.3.deb) local opensearch_file=$(get_extra_file "https://artifacts.opensearch.org/releases/bundle/opensearch/1.3.6/opensearch-1.3.6-linux-x64.tar.gz")
sudo dpkg -i --skip-same-version ${elasticsearch_file} sudo mkdir -p $OPENSEARCH_HOME
} sudo tar -xzpf ${opensearch_file} -C $OPENSEARCH_HOME --strip-components=1
sudo mkdir -p $OPENSEARCH_HOME/data /var/log/opensearch
function install_elasticsearch_fedora { sudo chown -R $STACK_USER $OPENSEARCH_HOME /var/log/opensearch
sudo yum install -y java-1.8.0-openjdk cat - <<EOF | sudo tee $OPENSEARCH_HOME/config/opensearch.yml >/dev/null
local elasticsearch_file=$(get_extra_file https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.3.rpm) discovery.type: single-node
sudo yum localinstall -y ${elasticsearch_file} path.data: /usr/share/opensearch/data
} path.logs: /var/log/opensearch
plugins.security.disabled: true
function install_elasticsearch { EOF
if is_ubuntu; then _run_under_systemd opensearch "$OPENSEARCH_HOME/bin/opensearch"
install_elasticsearch_ubuntu
elif is_fedora; then
install_elasticsearch_fedora
else
die $LINENO "Distribution must be Debian or Fedora-based"
fi
sudo systemctl start elasticsearch || sudo systemctl restart elasticsearch
} }
# install_cloudkitty() - Collect source and prepare # install_cloudkitty() - Collect source and prepare
@ -332,7 +325,7 @@ function install_cloudkitty {
if [ $CLOUDKITTY_STORAGE_BACKEND == 'influxdb' ]; then if [ $CLOUDKITTY_STORAGE_BACKEND == 'influxdb' ]; then
install_influx install_influx
elif [ $CLOUDKITTY_STORAGE_BACKEND == 'elasticsearch' ]; then elif [ $CLOUDKITTY_STORAGE_BACKEND == 'elasticsearch' ]; then
install_elasticsearch install_opensearch
fi fi
} }