diff --git a/.github/workflows/e2e.storages.yaml b/.github/workflows/e2e.storages.yaml index 0aec03a0c3972be115fafa6293a27ea8e6c7e25e..ba3a79843b585941e882d31bb00d2425973c9dcc 100644 --- a/.github/workflows/e2e.storages.yaml +++ b/.github/workflows/e2e.storages.yaml @@ -31,7 +31,7 @@ jobs: timeout-minutes: 90 strategy: matrix: - storage: ['mysql', 'es6', 'es7.0', 'es7.10', 'influxdb', 'tidb', 'postgresql'] + storage: ['mysql', 'es6', 'es7.0', 'es7.10', 'opensearch', 'influxdb', 'tidb', 'postgresql'] env: SW_STORAGE: ${{ matrix.storage }} steps: @@ -48,6 +48,11 @@ jobs: key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven- + + - name: Build OpenSearch + if: matrix.storage == 'opensearch' + run: bash test/e2e/e2e-test/docker/build-opensearch.sh + - name: Run E2E Test if: env.SKIP_CI != 'true' uses: ./.github/actions/e2e-test diff --git a/CHANGES.md b/CHANGES.md index d4d12cdc71817f4166b4e6bf2cfea1a9bf1c5c09..edcc8d95f09f812488ff60cdb806520f84510b92 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,7 +5,7 @@ Release Notes. 8.6.0 ------------------ #### Project - +* Add OpenSearch as storage option. #### Java Agent * Add `trace_segment_ref_limit_per_span` configuration mechanism to avoid OOM. diff --git a/docs/en/setup/backend/backend-storage.md b/docs/en/setup/backend/backend-storage.md index 0d0d282277decfd3df9966e8b0e1ddc0451a2728..4be32ca0f8f538cda21564a4ab73b2d43d8cbf51 100644 --- a/docs/en/setup/backend/backend-storage.md +++ b/docs/en/setup/backend/backend-storage.md @@ -9,6 +9,7 @@ storage: Native supported storage - H2 +- OpenSearch - ElasticSearch 6, 7 - MySQL - TiDB @@ -31,14 +32,25 @@ storage: user: sa ``` +## OpenSearch + +OpenSearch storage shares the same configurations as ElasticSearch 7. +In order to activate ElasticSearch 7 as storage, set storage provider to **elasticsearch7**. +Please download the `apache-skywalking-bin-es7.tar.gz` if you want to use OpenSearch as storage. + ## ElasticSearch + +**NOTICE:** Elastic announced through their blog that Elasticsearch will be moving over to a Server Side Public +License (SSPL), which is incompatible with Apache License 2.0. This license change is effective from Elasticsearch +version 7.11. So please choose the suitable ElasticSearch version according to your usage. + - In order to activate ElasticSearch 6 as storage, set storage provider to **elasticsearch** - In order to activate ElasticSearch 7 as storage, set storage provider to **elasticsearch7** **Required ElasticSearch 6.3.2 or higher. HTTP RestHighLevelClient is used to connect server.** -- For ElasticSearch 6.3.2 ~ 7.0.0 (excluded), please download the `apache-skywalking-bin.tar.gz` or `apache-skywalking-bin.zip`, -- For ElasticSearch 7.0.0 ~ 8.0.0 (excluded), please download the `apache-skywalking-bin-es7.tar.gz` or `apache-skywalking-bin-es7.zip`. +- For ElasticSearch 6.3.2 ~ 7.0.0 (excluded), please download the `apache-skywalking-bin.tar.gz`, +- For ElasticSearch 7.0.0 ~ 8.0.0 (excluded), please download the `apache-skywalking-bin-es7.tar.gz`. For now, ElasticSearch 6 and ElasticSearch 7 share the same configurations, as follows: diff --git a/test/e2e/e2e-test/docker/build-opensearch.sh b/test/e2e/e2e-test/docker/build-opensearch.sh new file mode 100644 index 0000000000000000000000000000000000000000..6db86ce4ccaf206d5f457ce109dff77de1e9b37d --- /dev/null +++ b/test/e2e/e2e-test/docker/build-opensearch.sh @@ -0,0 +1,27 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +set -ex + +wd=$(mktemp -d -t opensearch-XXXXXXXXXX) && cd "$wd" + +curl -L https://github.com/opensearch-project/OpenSearch/archive/1.0.0-beta1.tar.gz -o opensearch.tgz + +tar -zxf opensearch.tgz --strip-components=1 -C . + +./gradlew clean distribution:docker:assemble -x test -x javadoc diff --git a/test/e2e/e2e-test/docker/storage/docker-compose.opensearch.yml b/test/e2e/e2e-test/docker/storage/docker-compose.opensearch.yml new file mode 100644 index 0000000000000000000000000000000000000000..2724412be49937e8d2d024a420a1558859ffe294 --- /dev/null +++ b/test/e2e/e2e-test/docker/storage/docker-compose.opensearch.yml @@ -0,0 +1,47 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +version: '2.1' + +services: + es: + image: opensearch:test + expose: + - 9200 + networks: + - e2e + environment: + - discovery.type=single-node + - cluster.routing.allocation.disk.threshold_enabled=false + healthcheck: + test: ["CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/9200"] + interval: 5s + timeout: 60s + retries: 120 + + oap: + extends: + file: ../base-compose.yml + service: oap-es7 + environment: + SW_STORAGE: elasticsearch7 + SW_PROMETHEUS_FETCHER: "default" + SW_TELEMETRY: prometheus + depends_on: + es: + condition: service_healthy + +networks: + e2e: