dockerfile工具部署:【docker-compose.yml】
version: "3"
services:
elasticsearch7:
#往后安装不一定存在这个版本,可先查看新版本再选择
image: elasticsearch:7.12.0
container_name: elasticsearch7
restart: always
ports:
- 9200:9200
- 9300:9300
volumes:
- /data/devops/major-customer-boss/majorcustomer-mount/elasticsearch-mount/data:/usr/share/elasticsearch/data
- /data/devops/major-customer-boss/majorcustomer-mount/config-mount/elasticsearch/elasticsearch.yml:/usr/share/config/elasticsearch.yml
environment:
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- TZ=Asia/Shanghai
skywalking-oap:
image: apache/skywalking-oap-server:8.6.0-es7
container_name: skywalking-oap
depends_on:
- elasticsearch7
links:
- elasticsearch7
restart: always
ports:
- 11800:11800 # agent 上报数据的端口,这是 gRPC 端口
- 12800:12800 # ui 读取数据的端口, 这是 http 端口
volumes:
- /data/devops/major-customer-boss/majorcustomer-mount/config-mount/skyWalking/ext-config:/skywalking/ext-config
- /data/devops/major-customer-boss/majorcustomer-mount/config-mount/skyWalking/log4j2.xml:/skywalking/config/log4j2.xml
- /data/devops/major-customer-boss/majorcustomer-mount/config-mount/skyWalking/application.yml:/skywalking/config/application.yml
- /data/devops/major-customer-boss/majorcustomer-mount/log-mount/skyWalking-oap:/skywalking/logs
environment:
- TZ=Asia/Shanghai
skywalking-ui:
image: apache/skywalking-ui:8.6.0
container_name: skywalking-ui
depends_on:
- skywalking-oap
links:
- skywalking-oap
ports:
- 8688:8080
environment:
- SW_OAP_ADDRESS=10.0.555.100:12800
- security.user.admin.password=123456
- TZ=Asia/Shanghai
单独命令部署:
安装elasticsearch:
docker pull docker.elastic.co/elasticsearch/elasticsearch:7.13.4
docker images
netstat -anp|grep 9200
netstat -anp|grep 9300
docker run --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -d docker.elastic.co/elasticsearch/elasticsearch:7.13.4
安装SkyWalking Server端和UI:
docker pull apache/skywalking-base:8.6.0-es7
docker pull apache/skywalking-oap-server:8.6.0-es7
docker pull apache/skywalking-ui:8.6.0
docker run --name skywalking-oap --restart always -p 1234:1234 -p 11800:11800 -p 12800:12800 -d --link elasticsearch:elasticsearch -e SW_STORAGE=elasticsearch -e SW_STORAGE_ES_CLUSTER_NODES=10.0.555.100:9200 apache/skywalking-oap-server:8.6.0-es7
docker run --name skywalking-ui --restart always -p 9090:8080 --link skywalking-oap:skywalking-oap -d -e SW_OAP_ADDRESS=10.0.555.100:12800 apache/skywalking-ui:8.6.0
其他微服务部署[docker-compose.yml]:
version: "3"
services:
qq-service:
container_name: account-billing-service
image: 10.0.250.108/library/centos-openjdk-11:centos7.2.1511-200604
restart: always
# ports:
# - 11049:11049
command: java -javaagent:/opt/service/agent/skywalking-agent.jar -jar /opt/service/account-billing-service/account-billing-service.jar
volumes:
- ${DEPLOY_MOUNT_PATH}/services-mount/account-billing-service/:/opt/service/account-billing-service/
- ${DEPLOY_MOUNT_PATH}/log-mount/account-billing-service:/logs/account-billing-service/
- ${DEPLOY_MOUNT_PATH}/agent-mount/agent/:/opt/service/agent/
environment:
- TZ=Asia/Shanghai
- SERVICE_HOST=${HOST_IP}
- NACOS_NAMESPACE=${NACOS_NAMESPACE}
- NACOS_ADDR=${NACOS_ADDR}
- server.port=11049
- JAVA_OPTS=-Xmx512m -XX:G1ConcRefinementThreads=4 -XX:MaxDirectMemorySize=1G
- SW_AGENT_NAME=qq-service
deploy:
resources:
limits:
cpus: '0.5'
memory: 1G
env_file:
- ${DEPLOY_MOUNT_PATH}/config-mount/envFile/common_env.env
network_mode: host
#networks:
# - outside