Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sample config to run with opensearch #4512

Merged
merged 6 commits into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
use https and admin:admin for opensearch
  • Loading branch information
longquanzheng authored Sep 27, 2021
commit 5163f270de730f0308a85b809f31b6b6c3be6384
78 changes: 78 additions & 0 deletions docker/docker-compose-open-search.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
version: '3'
services:
cassandra:
image: cassandra:3.11
ports:
- "9042:9042"
prometheus:
image: prom/prometheus:latest
volumes:
- ./prometheus_config.yml:/etc/prometheus/prometheus.yml
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- '9090:9090'
zookeeper:
image: wurstmeister/zookeeper:3.4.6
ports:
- "2181:2181"
kafka:
image: wurstmeister/kafka:2.12-2.1.1
depends_on:
- zookeeper
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
elasticsearch:
image: opensearchproject/opensearch:latest
ports:
- "9200:9280"
- "9600:9600"
environment:
- discovery.type=single-node
cadence:
image: ubercadence/server:master-auto-setup
ports:
- "8000:8000"
- "8001:8001"
- "8002:8002"
- "8003:8003"
- "7933:7933"
- "7934:7934"
- "7935:7935"
- "7939:7939"
- "7833:7833"
environment:
- "CASSANDRA_SEEDS=cassandra"
- "PROMETHEUS_ENDPOINT_0=0.0.0.0:8000"
- "PROMETHEUS_ENDPOINT_1=0.0.0.0:8001"
- "PROMETHEUS_ENDPOINT_2=0.0.0.0:8002"
- "PROMETHEUS_ENDPOINT_3=0.0.0.0:8003"
- "DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development_es.yaml"
- "ENABLE_ES=true"
- "ES_SEEDS=elasticsearch"
- "ES_VERSION=v7"
- "KAFKA_SEEDS=kafka"
depends_on:
- cassandra
- prometheus
- kafka
- elasticsearch
cadence-web:
image: ubercadence/web:latest
environment:
- "CADENCE_TCHANNEL_PEERS=cadence:7933"
ports:
- "8088:8088"
depends_on:
- cadence
grafana:
image: grafana/grafana
user: "1000"
depends_on:
- prometheus
ports:
- '3000:3000'
11 changes: 9 additions & 2 deletions docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ DB="${DB:-cassandra}"
ENABLE_ES="${ENABLE_ES:-false}"
ES_PORT="${ES_PORT:-9200}"
ES_VERSION="${ES_VERSION:-v6}"
ES_TYPE="${ES_TYPE:-elasticsearch}" # elasticsearch or opensearch
RF=${RF:-1}

# cassandra env
Expand Down Expand Up @@ -60,9 +61,15 @@ setup_postgres_schema() {
setup_es_template() {
SCHEMA_FILE=$CADENCE_HOME/schema/elasticsearch/$ES_VERSION/visibility/index_template.json
server=`echo $ES_SEEDS | awk -F ',' '{print $1}'`
URL="http://$server:$ES_PORT/_template/cadence-visibility-template"
httpFix=''
curlFix=''
if [ "$ES_TYPE" == "opensearch" ]; then
httpFix='s'
curlFix=' -u admin:admin --insecure'
fi
URL="http$httpFix://$server:$ES_PORT/_template/cadence-visibility-template $curlFix"
curl -X PUT $URL -H 'Content-Type: application/json' --data-binary "@$SCHEMA_FILE"
URL="http://$server:$ES_PORT/cadence-visibility-dev"
URL="http$httpFix://$server:$ES_PORT/cadence-visibility-dev $curlFix"
curl -X PUT $URL
}

Expand Down