前面的文章《SkyWalking学习系列(一)Skywalking介绍》我们主要对skywalking做了一些基础的介绍,本文使用docker-compose来快速部署一套Skywalking的环境。对应的信息版本是:
elasticsearch: 7.5.0版本 skywalking-oap:8.1.0-es7版本 skywalking-ui:8.1.0版本
完整的docker-compose.yml文件内容如下:
version: '3.8' services: elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:7.5.0 container_name: elasticsearch restart: always ports: - 9200:9200 healthcheck: test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"] interval: 30s timeout: 10s retries: 3 start_period: 40s environment: - discovery.type=single-node - bootstrap.memory_lock=true - "ES_JAVA_OPTS=-Xms512m -Xmx512m" - TZ=Asia/Shanghai ulimits: memlock: soft: -1 hard: -1 oap: image: apache/skywalking-oap-server:8.1.0-es7 container_name: oap depends_on: - elasticsearch links: - elasticsearch restart: always ports: - 11800:11800 - 12800:12800 healthcheck: test: ["CMD-SHELL", "/skywalking/bin/swctl"] interval: 30s timeout: 10s retries: 3 start_period: 40s environment: TZ: Asia/Shanghai SW_STORAGE: elasticsearch7 SW_STORAGE_ES_CLUSTER_NODES: elasticsearch:9200 ui: image: apache/skywalking-ui:8.1.0 container_name: ui depends_on: - oap links: - oap restart: always ports: - 8080:8080 environment: TZ: Asia/Shanghai SW_OAP_ADDRESS: oap:12800
在服务器上创建完上诉的docker-compose文件之后,直接使用
docker-compose up -d
命令启动即可,如下图:
启动完成之后会有3个docker实例
此时我们就可以直接登录ui实例了,在浏览器访问地址是: http://${ip}:8080 。这里skywalking是不需要登录的,访问之后会直接出现dashboard。
以上就是使用docker-compose快速部署一套skywalking的教程,满足了skuwalking整体架构中的:
1、平台后端部分 2、存储部分 3、UI部分
剩下探针部分我们在后面的文章进行介绍。
备注:
1、如果想要使用skywalking做链路日志的话,可以升级下skywalking的版本,例如:
version: '3' services: elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:7.5.0 container_name: elasticsearch restart: always ports: - 9200:9200 healthcheck: test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"] interval: 30s timeout: 10s retries: 3 start_period: 40s environment: - discovery.type=single-node - bootstrap.memory_lock=true - "ES_JAVA_OPTS=-Xms512m -Xmx512m" - TZ=Asia/Shanghai ulimits: memlock: soft: -1 hard: -1 oap: image: apache/skywalking-oap-server:8.9.0 container_name: oap restart: always ports: - 11800:11800 # agent 上报数据的端口,这是 gRPC 端口 - 12800:12800 # ui 读取数据的端口, 这是 http 端口 environment: - TZ=Asia/Shanghai - SW_STORAGE=elasticsearch - SW_STORAGE_ES_CLUSTER_NODES=192.168.1.249:9200 - SW_HEALTH_CHECKER=default skywaling-ui: image: apache/skywalking-ui:8.9.0 container_name: ui depends_on: - oap links: - oap ports: - 8080:8080 environment: - SW_OAP_ADDRESS=http://192.168.1.249:12800 - TZ=Asia/Shanghai
还没有评论,来说两句吧...