1. proxychains4 git clone git@github.com:apache/skywalking.git

<br />

学习中的问题记录

克隆项目可以使用proxychains克隆

只需要1-2min不到就clone完了

mvnw是什么

mvnw是Maven Wrapper的缩写。因为我们安装Maven时,默认情况下,系统所有项目都会使用全局安装的这个Maven版本。但是,对于某些项目来说,它可能必须使用某个特定的Maven版本,这个时候,就可以使用Maven Wrapper,它可以负责给这个特定的项目安装指定版本的Maven,而其他项目不受影响。
简单地说,Maven Wrapper就是给一个项目提供一个独立的,指定版本的Maven给它使用。

编译花了1h

  1. [INFO] Executed tasks
  2. [INFO] ------------------------------------------------------------------------
  3. [INFO] Reactor Summary for apm 8.4.0:
  4. [INFO]
  5. [INFO] apm ................................................ SUCCESS [ 41.378 s]
  6. [INFO] apm-commons ........................................ SUCCESS [ 0.245 s]
  7. [INFO] apm-util ........................................... SUCCESS [ 20.668 s]
  8. [INFO] apm-datacarrier .................................... SUCCESS [ 6.104 s]
  9. [INFO] apm-protocol ....................................... SUCCESS [ 0.175 s]
  10. [INFO] apm-network ........................................ SUCCESS [03:50 min]
  11. [INFO] apm-sniffer ........................................ SUCCESS [ 0.103 s]
  12. [INFO] apm-agent-core ..................................... SUCCESS [ 46.836 s]
  13. [INFO] apm-agent .......................................... SUCCESS [ 10.880 s]
  14. [INFO] apm-test-tools ..................................... SUCCESS [ 2.006 s]
  15. [INFO] apm-sdk-plugin ..................................... SUCCESS [ 3.944 s]
  16. [INFO] dubbo-plugin ....................................... SUCCESS [ 7.133 s]
  17. [INFO] jdbc-commons ....................................... SUCCESS [ 31.885 s]
  18. [INFO] apm-httpclient-commons ............................. SUCCESS [ 1.436 s]
  19. [INFO] httpclient-4.x-plugin .............................. SUCCESS [ 4.799 s]
  20. [INFO] jedis-2.x-plugin ................................... SUCCESS [ 4.336 s]
  21. [INFO] redisson-3.x-plugin ................................ SUCCESS [ 11.927 s]
  22. [INFO] tomcat-7.x-8.x-plugin .............................. SUCCESS [ 6.004 s]
  23. [INFO] motan-plugin ....................................... SUCCESS [ 10.801 s]
  24. [INFO] mongodb-plugin ..................................... SUCCESS [ 6.196 s]
  25. [INFO] mongodb-plugin ..................................... SUCCESS [ 5.397 s]
  26. [INFO] apm-feign-default-http-9.x-plugin .................. SUCCESS [ 5.336 s]
  27. [INFO] okhttp-3.x-plugin .................................. SUCCESS [ 5.521 s]
  28. [INFO] apm-sdk-plugin ..................................... SUCCESS [ 0.240 s]
  29. [INFO] async-annotation-plugin ............................ SUCCESS [ 3.895 s]
  30. [INFO] spring-commons ..................................... SUCCESS [ 1.702 s]
  31. [INFO] concurrent-util-4.x-plugin ......................... SUCCESS [ 2.912 s]
  32. [INFO] resttemplate-4.3.x-plugin .......................... SUCCESS [ 2.815 s]
  33. [INFO] mvc-annotation-commons ............................. SUCCESS [ 4.640 s]
  34. [INFO] mvc-annotation-4.x-plugin .......................... SUCCESS [ 5.269 s]
  35. [INFO] spring-cloud ....................................... SUCCESS [ 0.261 s]
  36. [INFO] netflix-plugins .................................... SUCCESS [ 0.247 s]
  37. [INFO] spring-cloud-feign-1.x-plugin ...................... SUCCESS [ 1.904 s]
  38. [INFO] apm-spring-cloud-feign-2.x-plugin .................. SUCCESS [ 1.938 s]
  39. [INFO] mvc-annotation-3.x-plugin .......................... SUCCESS [ 6.967 s]
  40. [INFO] core-patch ......................................... SUCCESS [ 5.696 s]
  41. [INFO] mvc-annotation-5.x-plugin .......................... SUCCESS [ 6.293 s]
  42. [INFO] kafka-commons ...................................... SUCCESS [ 3.063 s]
  43. [INFO] apm-spring-kafka-1.x-plugin ........................ SUCCESS [ 7.271 s]
  44. [INFO] apm-spring-kafka-2.x-plugin ........................ SUCCESS [ 5.625 s]
  45. [INFO] scheduled-annotation-plugin ........................ SUCCESS [ 2.519 s]
  46. [INFO] spring-webflux-5.x-webclient-plugin ................ SUCCESS [ 2.972 s]
  47. [INFO] struts2-2.x-plugin ................................. SUCCESS [ 9.856 s]
  48. [INFO] apm-sdk-plugin ..................................... SUCCESS [ 0.206 s]
  49. [INFO] http-1.x-plugin .................................... SUCCESS [ 3.580 s]
  50. [INFO] mvc-annotation-1.x-plugin .......................... SUCCESS [ 1.732 s]
  51. [INFO] jetty-plugin ....................................... SUCCESS [ 0.166 s]
  52. [INFO] jetty-client-9.x-plugin ............................ SUCCESS [ 4.916 s]
  53. [INFO] jetty-server-9.x-plugin ............................ SUCCESS [ 5.522 s]
  54. [INFO] jetty-client-9.0-plugin ............................ SUCCESS [ 2.781 s]
  55. [INFO] spymemcached-2.x-plugin ............................ SUCCESS [ 3.159 s]
  56. [INFO] sharding-jdbc-1.5.x-plugin ......................... SUCCESS [ 9.088 s]
  57. [INFO] sharding-sphere-3.x-plugin ......................... SUCCESS [ 42.149 s]
  58. [INFO] sharding-sphere-4.x-plugin ......................... SUCCESS [ 39.915 s]
  59. [INFO] sharding-sphere-4.x-rc3-plugin ..................... SUCCESS [ 20.450 s]
  60. [INFO] sharding-sphere-4.0.x-plugin ....................... SUCCESS [ 16.970 s]
  61. [INFO] sharding-sphere-4.1.0-plugin ....................... SUCCESS [ 27.800 s]
  62. [INFO] xmemcached-2.x-plugin .............................. SUCCESS [ 7.439 s]
  63. [INFO] grpc-1.x-plugin .................................... SUCCESS [ 26.495 s]
  64. [INFO] apm-mysql-commons .................................. SUCCESS [ 24.082 s]
  65. [INFO] mysql-5.x-plugin ................................... SUCCESS [ 12.244 s]
  66. [INFO] mysql-6.x-plugin ................................... SUCCESS [ 2.628 s]
  67. [INFO] mysql-8.x-plugin ................................... SUCCESS [ 4.642 s]
  68. [INFO] h2-1.x-plugin ...................................... SUCCESS [ 21.116 s]
  69. [INFO] postgresql-8.x-plugin .............................. SUCCESS [ 14.660 s]
  70. [INFO] rocketMQ-3.x-plugin ................................ SUCCESS [ 25.843 s]
  71. [INFO] rocketMQ-4.x-plugin ................................ SUCCESS [ 11.549 s]
  72. [INFO] elastic-job-2.x-plugin ............................. SUCCESS [ 34.194 s]
  73. [INFO] elastic-job-3.x-plugin ............................. SUCCESS [ 13.744 s]
  74. [INFO] apm-mongodb-2.x-plugin ............................. SUCCESS [ 9.455 s]
  75. [INFO] httpasyncclient-4.x-plugin ......................... SUCCESS [ 10.305 s]
  76. [INFO] apm-kafka-plugin ................................... SUCCESS [ 4.878 s]
  77. [INFO] apm-sdk-plugin ..................................... SUCCESS [ 0.258 s]
  78. [INFO] servicecomb-java-chassis-0.x-plugin ................ SUCCESS [ 54.357 s]
  79. [INFO] servicecomb-java-chassis-1.x-plugin ................ SUCCESS [ 19.610 s]
  80. [INFO] apm-hystrix-1.x-plugin ............................. SUCCESS [ 4.458 s]
  81. [INFO] sofarpc-plugin ..................................... SUCCESS [ 15.764 s]
  82. [INFO] activemq-5.x-plugin ................................ SUCCESS [ 10.070 s]
  83. [INFO] elasticsearch-5.x-plugin ........................... SUCCESS [ 23.726 s]
  84. [INFO] elasticsearch-6.x-plugin ........................... SUCCESS [ 22.545 s]
  85. [INFO] undertow-plugins ................................... SUCCESS [ 0.143 s]
  86. [INFO] undertow-2.x-plugin ................................ SUCCESS [ 5.506 s]
  87. [INFO] rabbitmq-5.x-plugin ................................ SUCCESS [ 2.975 s]
  88. [INFO] apm-dubbo-conflict-path ............................ SUCCESS [ 1.254 s]
  89. [INFO] canal-1.x-plugin ................................... SUCCESS [ 13.899 s]
  90. [INFO] dubbo-2.7.x-plugin ................................. SUCCESS [ 3.036 s]
  91. [INFO] apm-dubbo-2.7.x-conflict-path ...................... SUCCESS [ 0.820 s]
  92. [INFO] vertx-plugins ...................................... SUCCESS [ 0.087 s]
  93. [INFO] vertx-core-3.x-plugin .............................. SUCCESS [ 11.744 s]
  94. [INFO] resteasy-plugin .................................... SUCCESS [ 0.068 s]
  95. [INFO] apm-resteasy-server-3.x-plugin ..................... SUCCESS [ 4.657 s]
  96. [INFO] solrj-7.x-plugin ................................... SUCCESS [ 5.535 s]
  97. [INFO] apm-cassandra-java-driver-3.x-plugin ............... SUCCESS [ 9.805 s]
  98. [INFO] light4j-plugins .................................... SUCCESS [ 0.116 s]
  99. [INFO] light4j-plugin ..................................... SUCCESS [ 9.307 s]
  100. [INFO] ehcache-2.x-plugin ................................. SUCCESS [ 4.197 s]
  101. [INFO] apm-pulsar-plugin .................................. SUCCESS [ 12.087 s]
  102. [INFO] netty-socketio-plugin .............................. SUCCESS [ 5.497 s]
  103. [INFO] armeria-0.84.x-plugin .............................. SUCCESS [01:11 min]
  104. [INFO] armeria-0.85.x-plugin .............................. SUCCESS [ 3.589 s]
  105. [INFO] httpclient-3.x-plugin .............................. SUCCESS [ 2.430 s]
  106. [INFO] play-2.x-plugin .................................... SUCCESS [ 15.005 s]
  107. [INFO] lettuce-5.x-plugin ................................. SUCCESS [ 4.824 s]
  108. [INFO] apm-avro-plugin .................................... SUCCESS [ 12.158 s]
  109. [INFO] apm-finagle-6.25.x-plugin .......................... SUCCESS [12:15 min]
  110. [INFO] quasar-plugin ...................................... SUCCESS [ 7.281 s]
  111. [INFO] mariadb-2.x-plugin ................................. SUCCESS [ 7.835 s]
  112. [INFO] apm-influxdb-2.x-plugin ............................ SUCCESS [ 4.493 s]
  113. [INFO] baidu-brpc-plugin .................................. SUCCESS [ 29.255 s]
  114. [INFO] hbase-1.x-plugin ................................... SUCCESS [01:08 min]
  115. [INFO] graphql-plugin ..................................... SUCCESS [ 0.148 s]
  116. [INFO] graphql-8.x-plugin ................................. SUCCESS [ 19.419 s]
  117. [INFO] graphql-9.x-plugin ................................. SUCCESS [ 20.161 s]
  118. [INFO] graphql-12.x-plugin ................................ SUCCESS [ 32.267 s]
  119. [INFO] xxl-job-2.x-plugin ................................. SUCCESS [02:50 min]
  120. [INFO] apm-thrift-plugin .................................. SUCCESS [ 2.069 s]
  121. [INFO] apm-asynchttpclient-2.x-plugin ..................... SUCCESS [ 10.641 s]
  122. [INFO] dbcp-2.x-plugin .................................... SUCCESS [ 1.983 s]
  123. [INFO] apm-mssql-commons .................................. SUCCESS [ 0.602 s]
  124. [INFO] mssql-jtds-1.x-plugin .............................. SUCCESS [ 2.696 s]
  125. [INFO] mssql-jdbc-plugin .................................. SUCCESS [ 8.900 s]
  126. [INFO] cxf-3.x-plugin ..................................... SUCCESS [ 13.972 s]
  127. [INFO] apm-application-toolkit ............................ SUCCESS [ 0.036 s]
  128. [INFO] apm-toolkit-trace .................................. SUCCESS [ 0.541 s]
  129. [INFO] apm-toolkit-activation ............................. SUCCESS [ 0.075 s]
  130. [INFO] apm-toolkit-kafka-activation ....................... SUCCESS [ 0.614 s]
  131. [INFO] apm-toolkit-log4j-1.x .............................. SUCCESS [ 0.511 s]
  132. [INFO] apm-toolkit-logging-common ......................... SUCCESS [ 0.674 s]
  133. [INFO] apm-toolkit-log4j-1.x-activation ................... SUCCESS [ 0.836 s]
  134. [INFO] apm-toolkit-log4j-2.x-activation ................... SUCCESS [ 8.230 s]
  135. [INFO] apm-toolkit-logback-1.x-activation ................. SUCCESS [ 0.896 s]
  136. [INFO] apm-toolkit-opentracing ............................ SUCCESS [ 0.710 s]
  137. [INFO] apm-toolkit-opentracing-activation ................. SUCCESS [ 1.407 s]
  138. [INFO] apm-toolkit-trace-activation ....................... SUCCESS [ 1.575 s]
  139. [INFO] apm-toolkit-meter .................................. SUCCESS [ 1.085 s]
  140. [INFO] apm-toolkit-meter-activation ....................... SUCCESS [ 1.209 s]
  141. [INFO] bootstrap-plugins .................................. SUCCESS [ 0.065 s]
  142. [INFO] apm-jdk-http-plugin ................................ SUCCESS [ 0.755 s]
  143. [INFO] apm-jdk-threading-plugin ........................... SUCCESS [ 0.667 s]
  144. [INFO] optional-plugins ................................... SUCCESS [ 0.067 s]
  145. [INFO] optional-spring-plugins ............................ SUCCESS [ 0.082 s]
  146. [INFO] apm-spring-annotation-plugin ....................... SUCCESS [ 10.718 s]
  147. [INFO] apm-spring-tx-plugin ............................... SUCCESS [ 4.211 s]
  148. [INFO] apm-spring-webflux-5.x-plugin ...................... SUCCESS [ 0.621 s]
  149. [INFO] optional-spring-cloud .............................. SUCCESS [ 0.057 s]
  150. [INFO] gateway-2.0.x-plugin ............................... SUCCESS [ 18.742 s]
  151. [INFO] gateway-2.1.x-plugin ............................... SUCCESS [ 12.583 s]
  152. [INFO] apm-trace-ignore-plugin ............................ SUCCESS [ 1.349 s]
  153. [INFO] gson-2.8.x-plugin .................................. SUCCESS [ 1.104 s]
  154. [INFO] zookeeper-3.4.x-plugin ............................. SUCCESS [ 1.388 s]
  155. [INFO] customize-enhance-plugin ........................... SUCCESS [ 1.456 s]
  156. [INFO] kotlin-coroutine-plugin ............................ SUCCESS [ 2.276 s]
  157. [INFO] quartz-scheduler-2.x-plugin ........................ SUCCESS [ 2.560 s]
  158. [INFO] optional-reporter-plugins .......................... SUCCESS [ 0.038 s]
  159. [INFO] kafka-reporter-plugin .............................. SUCCESS [01:21 min]
  160. [INFO] apm-toolkit-log4j-2.x .............................. SUCCESS [ 0.542 s]
  161. [INFO] apm-toolkit-logback-1.x ............................ SUCCESS [ 8.019 s]
  162. [INFO] apm-toolkit-micrometer-registry .................... SUCCESS [ 9.063 s]
  163. [INFO] apm-toolkit-kafka .................................. SUCCESS [ 0.549 s]
  164. [INFO] oap-server ......................................... SUCCESS [ 5.335 s]
  165. [INFO] server-library ..................................... SUCCESS [ 0.069 s]
  166. [INFO] library-util ....................................... SUCCESS [ 12.787 s]
  167. [INFO] library-module ..................................... SUCCESS [ 1.399 s]
  168. [INFO] server-telemetry ................................... SUCCESS [ 0.072 s]
  169. [INFO] telemetry-api ...................................... SUCCESS [ 0.819 s]
  170. [INFO] server-configuration ............................... SUCCESS [ 0.075 s]
  171. [INFO] configuration-api .................................. SUCCESS [ 1.295 s]
  172. [INFO] library-client ..................................... SUCCESS [ 31.728 s]
  173. [INFO] library-server ..................................... SUCCESS [ 11.057 s]
  174. [INFO] server-testing ..................................... SUCCESS [ 1.021 s]
  175. [INFO] server-core ........................................ SUCCESS [ 14.065 s]
  176. [INFO] analyzer ........................................... SUCCESS [ 0.198 s]
  177. [INFO] meter-analyzer ..................................... SUCCESS [ 3.782 s]
  178. [INFO] agent-analyzer ..................................... SUCCESS [ 2.819 s]
  179. [INFO] log-analyzer ....................................... SUCCESS [ 1.334 s]
  180. [INFO] server-receiver-plugin ............................. SUCCESS [ 0.632 s]
  181. [INFO] skywalking-sharing-server-plugin ................... SUCCESS [ 1.379 s]
  182. [INFO] skywalking-trace-receiver-plugin ................... SUCCESS [ 2.526 s]
  183. [INFO] server-storage-plugin .............................. SUCCESS [ 0.082 s]
  184. [INFO] storage-elasticsearch-plugin ....................... SUCCESS [02:09 min]
  185. [INFO] storage-zipkin-plugin .............................. SUCCESS [ 4.055 s]
  186. [INFO] skywalking-management-receiver-plugin .............. SUCCESS [ 1.300 s]
  187. [INFO] zipkin-receiver-plugin ............................. SUCCESS [ 6.857 s]
  188. [INFO] skywalking-mesh-receiver-plugin .................... SUCCESS [ 1.646 s]
  189. [INFO] skywalking-jvm-receiver-plugin ..................... SUCCESS [ 1.040 s]
  190. [INFO] receiver-proto ..................................... SUCCESS [ 31.561 s]
  191. [INFO] envoy-metrics-receiver-plugin ...................... SUCCESS [01:14 min]
  192. [INFO] skywalking-clr-receiver-plugin ..................... SUCCESS [ 1.186 s]
  193. [INFO] storage-jaeger-plugin .............................. SUCCESS [ 1.310 s]
  194. [INFO] jaeger-receiver-plugin ............................. SUCCESS [ 1.152 s]
  195. [INFO] skywalking-profile-receiver-plugin ................. SUCCESS [ 1.251 s]
  196. [INFO] otel-receiver-plugin ............................... SUCCESS [ 1.303 s]
  197. [INFO] skywalking-meter-receiver-plugin ................... SUCCESS [ 1.732 s]
  198. [INFO] skywalking-browser-receiver-plugin ................. SUCCESS [ 2.004 s]
  199. [INFO] skywalking-log-recevier-plugin ..................... SUCCESS [ 1.149 s]
  200. [INFO] configuration-discovery-receiver-plugin ............ SUCCESS [ 1.804 s]
  201. [INFO] server-cluster-plugin .............................. SUCCESS [ 0.106 s]
  202. [INFO] cluster-zookeeper-plugin ........................... SUCCESS [ 3.127 s]
  203. [INFO] cluster-standalone-plugin .......................... SUCCESS [ 1.500 s]
  204. [INFO] cluster-kubernetes-plugin .......................... SUCCESS [ 2.115 s]
  205. [INFO] cluster-consul-plugin .............................. SUCCESS [ 8.786 s]
  206. [INFO] cluster-etcd-plugin ................................ SUCCESS [ 10.522 s]
  207. [INFO] cluster-nacos-plugin ............................... SUCCESS [ 6.916 s]
  208. [INFO] storage-jdbc-hikaricp-plugin ....................... SUCCESS [ 21.006 s]
  209. [INFO] storage-elasticsearch7-plugin ...................... SUCCESS [ 26.061 s]
  210. [INFO] storage-influxdb-plugin ............................ SUCCESS [ 1.920 s]
  211. [INFO] storage-tidb-plugin ................................ SUCCESS [ 1.082 s]
  212. [INFO] oal-grammar ........................................ SUCCESS [ 12.690 s]
  213. [INFO] oal-rt ............................................. SUCCESS [ 2.764 s]
  214. [INFO] server-fetcher-plugin .............................. SUCCESS [ 0.089 s]
  215. [INFO] prometheus-fetcher-plugin .......................... SUCCESS [ 2.297 s]
  216. [INFO] kafka-fetcher-plugin ............................... SUCCESS [ 26.018 s]
  217. [INFO] server-health-checker .............................. SUCCESS [ 1.219 s]
  218. [INFO] server-query-plugin ................................ SUCCESS [ 0.064 s]
  219. [INFO] query-graphql-plugin ............................... SUCCESS [ 12.452 s]
  220. [INFO] server-alarm-plugin ................................ SUCCESS [ 25.252 s]
  221. [INFO] telemetry-prometheus ............................... SUCCESS [ 2.741 s]
  222. [INFO] exporter ........................................... SUCCESS [ 2.633 s]
  223. [INFO] grpc-configuration-sync ............................ SUCCESS [ 1.831 s]
  224. [INFO] configuration-apollo ............................... SUCCESS [ 7.141 s]
  225. [INFO] configuration-zookeeper ............................ SUCCESS [ 1.689 s]
  226. [INFO] configuration-etcd ................................. SUCCESS [ 1.390 s]
  227. [INFO] configuration-consul ............................... SUCCESS [ 1.727 s]
  228. [INFO] configuration-k8s-configmap ........................ SUCCESS [ 2.120 s]
  229. [INFO] configuration-nacos ................................ SUCCESS [ 2.232 s]
  230. [INFO] server-bootstrap ................................... SUCCESS [ 3.285 s]
  231. [INFO] server-tools ....................................... SUCCESS [ 0.058 s]
  232. [INFO] profile-exporter ................................... SUCCESS [ 0.054 s]
  233. [INFO] tool-profile-snapshot-server-mock .................. SUCCESS [ 1.031 s]
  234. [INFO] tool-profile-snapshot-bootstrap .................... SUCCESS [ 2.801 s]
  235. [INFO] tool-profile-snapshot-exporter ..................... SUCCESS [ 1.722 s]
  236. [INFO] server-starter ..................................... SUCCESS [05:09 min]
  237. [INFO] tool-profile-snapshot-exporter-es7 ................. SUCCESS [ 1.677 s]
  238. [INFO] server-starter-es7 ................................. SUCCESS [ 3.461 s]
  239. [INFO] apm-webapp ......................................... SUCCESS [02:02 min]
  240. [INFO] apache-skywalking-apm .............................. SUCCESS [ 25.251 s]
  241. [INFO] apache-skywalking-apm-es7 .......................... SUCCESS [ 13.755 s]
  242. [INFO] ------------------------------------------------------------------------
  243. [INFO] BUILD SUCCESS
  244. [INFO] ------------------------------------------------------------------------
  245. [INFO] Total time: 01:00 h
  246. [INFO] Finished at: 2021-06-26T19:21:20+08:00
  247. [INFO] ------------------------------------------------------------------------

编译

image.pngimage.png

1. Skywalking OAP 配置集群

环境变量表:https://skywalking.apache.org/docs/main/v8.4.0/en/setup/backend/configuration-vocabulary/
参考官方文档:https://skywalking.apache.org/docs/main/v8.4.0/en/setup/backend/backend-cluster/#nacos

使用docker镜像配置

1.1 增加nacos配置

nacos01:
    image: nacos/nacos-server:${NACOS_VERSION}
    container_name: nacos01
    networks:
      skywalking_networks:
        ipv4_address: 192.168.200.30
    volumes:
      - ./nacos/nacos01/logs:/home/nacos/logs
      - ./nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties
    ports:
      - "8848:8848"
      - "9848:9848"
      - "9555:9555"
    expose:
      - "8848"
      - "9848"
      - "9555"
    environment:
      - JVM_XMS=128m
      - JVM_XMX=512m
      - JVM_XMN=256m
      - JVM_MS=128m
      - JVM_MMS=256m
      - NACOS_SERVERS=192.168.200.30:8848 192.168.200.31:8848 192.168.200.32:8848
      - MYSQL_SERVICE_HOST=192.168.200.40
      - MYSQL_SERVICE_DB_NAME=nacos_devtest
      - MYSQL_SERVICE_PORT=3306
      - MYSQL_SERVICE_USER=nacos
      - MYSQL_SERVICE_PASSWORD=nacos
      - MYSQL_SERVICE_DB_PARAM=characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
    depends_on:
      - mysql

1.2 配置两个oap,复制两个

在skywalking download页面找到:https://skywalking.apache.org/downloads/#docker-images-for-convenience

  skywalking-oap01:
    image: apache/skywalking-oap-server:${TAG}
    container_name: skywalking-oap01
    depends_on:
      - es01
      - es02
      # - es03
      - nacos01
      - nacos02
      - nacos03
    volumes:
      - "./skywalking/oap/oap01/config:/skywalking/config"
    ports:
      - 11801:11800
      - 12801:12800
    expose:
      - "11800"
      - "12800"
    environment:
      JAVA_OPTS: " -Xms256M -Xmx1024M"
      # es7存储
      SW_STORAGE: elasticsearch7
      SW_STORAGE_ES_CLUSTER_NODES: 192.168.200.10:9200,192.168.200.11:9200,192.168.200.12:9200
      # 健康检查
      SW_HEALTH_CHECKER: default
      # telemetry 与 prometheus
      SW_TELEMETRY: prometheus
      # 需要更改self->staticConfig->targets->url为当前容器名
      # SW_PROMETHEUS_FETCHER: default
      TZ: Asia/Shanghai

 skywalking-oap02:
    image: apache/skywalking-oap-server:${TAG}
    container_name: skywalking-oap01
    depends_on:
      - es01
      - es02
      # - es03
      - nacos01
      - nacos02
      - nacos03
    volumes:
      - "./skywalking/oap/oap01/config:/skywalking/config"
    ports:
      - 11801:11800
      - 12801:12800
    expose:
      - "11800"
      - "12800"
    environment:
      JAVA_OPTS: " -Xms256M -Xmx1024M"
      # es7存储
      SW_STORAGE: elasticsearch7
      SW_STORAGE_ES_CLUSTER_NODES: 192.168.200.10:9200,192.168.200.11:9200,192.168.200.12:9200
      # 健康检查
      SW_HEALTH_CHECKER: default
      # telemetry 与 prometheus
      SW_TELEMETRY: prometheus
      # 需要更改self->staticConfig->targets->url为当前容器名
      # SW_PROMETHEUS_FETCHER: default
      TZ: Asia/Shanghai

1.3 配置环境变量

environment:
      SW_CLUSTER: nacos
      SW_CLUSTER_NACOS_HOST_PORT: 192.168.200.30:8848,192.168.200.31:8848,192.168.200.32:8848
      SW_CLUSTER_NACOS_USERNAME: nacos
      SW_CLUSTER_NACOS_PASSWORD: nacos
      SW_CLUSTER_NACOS_INTERNAL_COM_HOST: 192.168.200.100
      SW_CLUSTER_NACOS_INTERNAL_COM_PORT: 11800

2. Skywalking OAP 动态配置并验证

Dynamic Confirguration:https://github.com/apache/skywalking/blob/master/docs/en/setup/backend/dynamic-config.md

可动态配置的参数包含:

  • 指定多少ms内为DB慢查询
  • gateways
  • 告警设置
  • apdex
  • endpoint分组名
  • 采样率
  • 慢链路的延时
  • [configuration-discovery.md](https://github.com/apache/skywalking/blob/master/docs/en/setup/service-agent/java-agent/configuration-discovery.md) 网关或代理

动态配置需要一个配置中心,这里我们选用nacos,参考官网文档:https://github.com/apache/skywalking/blob/master/docs/en/setup/backend/dynamic-config.md#dynamic-configuration-nacos-implementation

Docker文件中增加配置

      SW_CONFIGURATION: nacos
      SW_CONFIG_NACOS_SERVER_ADDR: nacos01
      SW_CONFIG_NACOS_SERVER_PORT: 8848
      SW_CONFIG_NACOS_SERVER_GROUP: skywalking
      SW_CONFIG_NACOS_SERVER_NAMESPACE: skywalking
      SW_CONFIG_NACOS_USERNAME: nacos
      SW_CONFIG_NACOS_PASSWORD: nacos

Nacos添加配置image.png

3. 启动 live-demo 项目,访问测试端点,在 UI 上验证

  • curl "http://localhost:8764/projectA/test"

<br />
<br />
![image.png](https://cdn.nlark.com/yuque/0/2021/png/282837/1624782398517-1fe23ddb-6153-420a-b041-2611b484473d.png#align=left&display=inline&height=952&margin=%5Bobject%20Object%5D&name=image.png&originHeight=1904&originWidth=3264&size=512154&status=done&style=none&width=1632)