docker安装skywalking

官网:https://skywalking.apache.org/downloads/#DockerImages

docker pull apache/skywalking-oap-server:8.9.1
docker run --name skywalking-oap -it -p 11800:11800 -p 12800:12800 -e TZ=Asia/Shanghai -e JAVA_OPTS="-Xms128m -Xmx128m" -e SW_STORAGE=elasticsearch -e SW_NAMESPACE=collectorDBCluster -e SW_STORAGE_ES_CLUSTER_NODES=10.0.4.3:9200 apache/skywalking-oap-server:8.9.1

storage:
selector: ${SW_STORAGE:h2}
elasticsearch:
namespace: ${SW_NAMESPACE:“collectorDBCluster”}
clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:121.4.63.94:9200}
protocol: ${SW_STORAGE_ES_HTTP_PROTOCOL:“https”}
connectTimeout: ${SW_STORAGE_ES_CONNECT_TIMEOUT:3000}
socketTimeout: ${SW_STORAGE_ES_SOCKET_TIMEOUT:30000}
responseTimeout: ${SW_STORAGE_ES_RESPONSE_TIMEOUT:15000}
numHttpClientThread: ${SW_STORAGE_ES_NUM_HTTP_CLIENT_THREAD:0}
user: ${SW_ES_USER:“elastic用户https时必填”}
password: ${SW_ES_PASSWORD:“你的密码必填https时必填”}
trustStorePath: ${SW_STORAGE_ES_SSL_JKS_PATH:“/skywalking/http.jks”}#https时必填
trustStorePass: ${SW_STORAGE_ES_SSL_JKS_PASS:“jks证书的密码”}#https时必填


docker run --cap-add=SYS_PTRACE --name skywalking-oap -it -p 11800:11800 -p 12800:12800 -e TZ=Asia/Shanghai -e JAVA_OPTS="-Xms128m -Xmx128m" -e SW_STORAGE=elasticsearch -v /opt/services/skywalking/http.jks:/skywalking/http.jks -v /opt/services/skywalking/ext-config:/skywalking/ext-config apache/skywalking-oap-server:9.1.0

启动UI

docker run --name skywalking-ui -p 19080:8080 -it -e SW_OAP_ADDRESS=http://10.0.4.3:12800 -e TZ=Asia/Shanghai -e JAVA_OPTS="-Xms64m -Xmx64m" apache/skywalking-ui:8.9.1

docker run --name skywalking-ui -p 19080:8080 -it -e SW_OAP_ADDRESS=http://121.4.63.94:12800 -e TZ=Asia/Shanghai -e JAVA_OPTS="-Xms64m -Xmx64m" apache/skywalking-ui:9.1.0
p12转jks
./jdk/bin/keytool -importkeystore -srckeystore config/certs/transport.p12 -srcstoretype PKCS12 -deststoretype JKS -destkeystore transport.jks
jks转p12
./jdk/bin/keytool -importkeystore -srckeystore transport.jks -destkeystore transport.jks -deststoretype pkcs12

springboot项目使用agent
参考:https://hub.docker.com/r/apache/skywalking-java-agent

wget https://dlcdn.apache.org/skywalking/java-agent/8.11.0/apache-skywalking-java-agent-8.11.0.tgz
tar zxvf apache-skywalking-java-agent-8.11.0.tgz -C /opt/services/sill
cd /opt/services/sill
cp -r -p skywalking-agent  skywalking-agent-forgateway
# skywalking-agent给一般项目用 skywalking-agent-forgateway给spring cloud gateway用
#gateway用了webflux,需另外两个plugins
cd /opt/services/sill/skywalking-agent-forgateway
cp optional-plugins/apm-spring-cloud-gateway-3.x-plugin-8.11.0.jar plugins
cp optional-plugins/apm-spring-webflux-5.x-plugin-8.11.0.jar plugins

docker run -p 13001:13001 -v /opt/services/sill/sill-gateway/logs:/opt/services/sill/sill-gateway/logs -v /opt/services/sill/skywalking-agent-forgateway:/opt/services/sill/skywalking-agent --env JAVA_AGENT=-javaagent:/opt/services/sill/skywalking-agent/skywalking-agent.jar --env JAVA_OPTS="-Xmx64M -Xms64M -Xmn32M -XX:MaxMetaspaceSize=128M -XX:MetaspaceSize=64M" --env SW_AGENT_COLLECTOR_BACKEND_SERVICES=121.4.63.94:11800 --env SW_AGENT_INSTANCE_NAME=sill-gateway --env SW_AGENT_NAME=sill-gateway --env SW_LOGGING_DIR=/opt/services/sill/sill-gateway/logs --name sill-gateway -d sill-gateway:1.0 

你可能感兴趣的:(docker,elasticsearch,java)