From 0f6c91c4bf2733ae3251e362a907cdf0658791fe Mon Sep 17 00:00:00 2001 From: BryantHe Date: Thu, 2 Nov 2023 12:08:00 +0800 Subject: [PATCH] fix: update tracing --- README.md | 4 +- docker-compose-skywalking.yml | 136 ++++++++++++++++++++++++++++++++++ docker-compose-tracing.yml | 59 --------------- 3 files changed, 138 insertions(+), 61 deletions(-) create mode 100644 docker-compose-skywalking.yml delete mode 100644 docker-compose-tracing.yml diff --git a/README.md b/README.md index 33abc09..5f9de83 100644 --- a/README.md +++ b/README.md @@ -47,11 +47,11 @@ grafana 的配置在:./service_configs/admin_service/grafana/xxxx.json (根 `docker-compose -f docker-compose-metrics-server.yml up -d --build` -## 启动 Tracing 相关服务 +## 启动 Skywalking 相关服务 启动服务的命令: -`docker-compose -f docker-compose-tracing.yml up -d --build` +`docker-compose -f docker-compose-skywalking.yml up -d --build` ## 启动 Logging 相关服务 diff --git a/docker-compose-skywalking.yml b/docker-compose-skywalking.yml new file mode 100644 index 0000000..339bc5d --- /dev/null +++ b/docker-compose-skywalking.yml @@ -0,0 +1,136 @@ +version: '3.8' +services: + + skywalking-oap: + image: apache/skywalking-oap-server:9.6.0 + container_name: skywalking-oap + depends_on: + skywalking-elasticsearch: + condition: service_healthy + links: + - skywalking-elasticsearch + ports: + - "11800:11800" + - "12800:12800" + healthcheck: + test: [ "CMD-SHELL", "/skywalking/bin/swctl ch" ] + interval: 30s + timeout: 10s + retries: 3 + start_period: 10s + environment: +# SW_KAFKA_FETCHER: default +# SW_KAFKA_FETCHER_ENABLE_METER_SYSTEM: true +# SW_KAFKA_FETCHER_PARTITIONS: 3 +# SW_KAFKA_FETCHER_PARTITIONS_FACTOR: 1 +# SW_KAFKA_FETCHER_ENABLE_NATIVE_PROTO_LOG: true +# SW_KAFKA_FETCHER_ENABLE_NATIVE_JSON_LOG: true +# SW_KAFKA_FETCHER_SERVERS: kafka:9092 +# SW_KAFKA_FETCHER_CONSUMERS: 1 +# SW_KAFKA_HANDLER_THREAD_POOL_SIZE: -1 +# SW_KAFKA_HANDLER_THREAD_POOL_QUEUE_SIZE: -1 + SW_STORAGE: elasticsearch + SW_STORAGE_ES_CLUSTER_NODES: skywalking-elasticsearch:9200 + SW_HEALTH_CHECKER: default + SW_TELEMETRY: prometheus + SW_NAMESPACE: diyue + JAVA_OPTS: "-Xms2048m -Xmx2048m" + TZ: Asia/Shanghai + restart: on-failure + networks: + skywalking_network: + + skywalking-ui: + image: apache/skywalking-ui:9.6.0 + container_name: skywalking-ui + depends_on: + skywalking-oap: + condition: service_healthy + links: + - skywalking-oap + ports: + - "8080:8080" + environment: + SW_OAP_ADDRESS: http://skywalking-oap:12800 + SW_ZIPKIN_ADDRESS: http://skywalking-oap:9412 + SW_HEALTH_CHECKER: default + TZ: Asia/Shanghai + healthcheck: + test: [ "CMD-SHELL", "curl -sf http://localhost:8080 || exit 1" ] #⼼跳检测,成功之后不再执⾏后⾯的退出 + interval: 60s #⼼跳检测间隔周期 + timeout: 10s + retries: 3 + start_period: 60s #⾸次检测延迟时间 + networks: + skywalking_network: + + skywalking-elasticsearch: + image: elasticsearch:8.4.2 + container_name: skywalking-elasticsearch + ports: + - "9200:9200" + healthcheck: + test: [ "CMD-SHELL", "curl -sf http://localhost:9200/_cluster/health || exit 1" ] #⼼跳检测,成功之后不再执⾏后⾯的退出 + interval: 60s #⼼跳检测间隔周期 + timeout: 10s + retries: 3 + start_period: 60s #⾸次检测延迟时间 + environment: + discovery.type: single-node #单节点模式 + ingest.geoip.downloader.enabled: "false" + bootstrap.memory_lock: "true" + ES_JAVA_OPTS: "-Xms512m -Xmx512m" + TZ: "Asia/Shanghai" + xpack.security.enabled: "false" #单机模式 + ulimits: + memlock: + soft: -1 + hard: -1 + networks: + skywalking_network: + +# zoo: +# image: confluentinc/cp-zookeeper:7.3.2 +# hostname: zoo +# container_name: zoo +# ports: +# - "2181:2181" +# environment: +# ZOOKEEPER_CLIENT_PORT: 2181 +# ZOOKEEPER_SERVER_ID: 1 +# ZOOKEEPER_SERVERS: zoo:2888:3888 +# networks: +# skywalking_network: +# +# kafka: +# image: confluentinc/cp-kafka:7.3.2 +# hostname: kafka +# container_name: kafka +# ports: +# - "9092:9092" +# - "29092:29092" +# - "9999:9999" +# environment: +# KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:19092,EXTERNAL://kafka:9092,DOCKER://host.docker.internal:29092 +# KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,DOCKER:PLAINTEXT +# KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL +# KAFKA_ZOOKEEPER_CONNECT: "zoo:2181" +# KAFKA_BROKER_ID: 1 +# KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO" +# KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 +# KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 +# KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 +# KAFKA_JMX_PORT: 9999 +# KAFKA_JMX_HOSTNAME: 127.0.0.1 +# KAFKA_AUTHORIZER_CLASS_NAME: kafka.security.authorizer.AclAuthorizer +# KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: "true" +# depends_on: +# - zoo +# links: +# - zoo +# networks: +# skywalking_network: + +networks: + skywalking_network: + driver: bridge \ No newline at end of file diff --git a/docker-compose-tracing.yml b/docker-compose-tracing.yml deleted file mode 100644 index 9f29455..0000000 --- a/docker-compose-tracing.yml +++ /dev/null @@ -1,59 +0,0 @@ -version: '3.8' -services: - elasticsearch: - image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.4.2 - container_name: elasticsearch - ports: - - "9200:9200" - healthcheck: - test: [ "CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1" ] - interval: 30s - timeout: 10s - retries: 3 - start_period: 10s - environment: - - discovery.type=single-node - - bootstrap.memory_lock=true - - "ES_JAVA_OPTS=-Xms512m -Xmx512m" - ulimits: - memlock: - soft: -1 - hard: -1 - - oap: - image: skywalking/oap:latest - container_name: oap - depends_on: - elasticsearch: - condition: service_healthy - links: - - elasticsearch - ports: - - "11800:11800" - - "12800:12800" - healthcheck: - test: [ "CMD-SHELL", "/skywalking/bin/swctl ch" ] - interval: 30s - timeout: 10s - retries: 3 - start_period: 10s - environment: - SW_STORAGE: elasticsearch - SW_STORAGE_ES_CLUSTER_NODES: elasticsearch:9200 - SW_HEALTH_CHECKER: default - SW_TELEMETRY: prometheus - JAVA_OPTS: "-Xms2048m -Xmx2048m" - - ui: - image: skywalking/ui:latest - container_name: ui - depends_on: - oap: - condition: service_healthy - links: - - oap - ports: - - "8080:8080" - environment: - SW_OAP_ADDRESS: http://oap:12800 - SW_ZIPKIN_ADDRESS: http://oap:9412 \ No newline at end of file