1、部署ES

Docker 启动用户要是 elasticsearch
单机要配置discovery.type=single-node
开启集群内访问9200

docker run  -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" \
--name='elasticsearch' \
-d elasticsearch:8.7.0

elasticsearch.yml 配置文件

network.host: 0.0.0.0
#----------------------- BEGIN SECURITY AUTO CONFIGURATION -----------------------
#
# The following settings, TLS certificates, and keys have been automatically      
# generated to configure Elasticsearch security features on 08-04-2023 18:34:05
#
# --------------------------------------------------------------------------------

# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
  enabled: false
#----------------------- END SECURITY AUTO CONFIGURATION -------------------------

ES重置密码

elasticsearch-reset-password -u elastic

如果没有权限报不能使用root启动,使用如下命令创建新用户,使用该用户启动

groupadd es 
useradd es -g es -p password # -g 指定组 -p 密码

2、部署Skywalking

部署skywalking-oap-server

开启集群内访问 12800

docker run -d --name skywalking-oap-server \
-p 12800:12800 -p 11800:11800 \
-v /Users/chenjujun/sdk/skywalking/application.yml:/skywalking/config/application.yml \
-v /Users/chenjujun/sdk/skywalking/alarm-settings.yml:/skywalking/config/alarm-settings.yml \
apache/skywalking-oap-server:9.4.0

或者使用 容器名引用ES地址:

docker run -d --name skywalking-oap-server \
-p 12800:12800 -p 11800:11800 \
--link elasticsearch:elasticsearch \
-e SW_STORAGE=elasticsearch -e SW_STORAGE_ES_CLUSTER_NODES=elasticsearch:9200 \
-v /Users/chenjujun/sdk/skywalking/application.yml:/skywalking/config/application.yml \
-v /Users/chenjujun/sdk/skywalking/alarm-settings.yml:/skywalking/config/alarm-settings.yml \
apache/skywalking-oap-server:9.4.0

application.yml 配置调整
Skywalking 的Docker部署测试-Tempo替代方案-LMLPHP
alarm-settings.yml配置调整

部署skywalking-ui

需要配置OAP 地址

docker run -d --name skywalking-ui \
-p 8088:8080 \
-e SW_OAP_ADDRESS=http://10.247.181.214:12800 \
apache/skywalking-ui:9.4.0

Agent 设置

-javaagent:/Users/chenjujun/Downloads/skywalking-agent/skywalking-agent.jar
-Dskywalking.agent.service_name=phantom-gateway-open
-Dskywalking.collector.backend_service=127.0.0.1:11800

附录


01-13 09:19