skywalking配置nacos集群模式

版本:

name version
nacos 1.1.0
skywalking 6.2.0
elasticsearch 6.3.2

es集群管理工具 cerebro-0.8.3 https://github.com/lmenezes/cerebro

前置:

es、nacos至少各有一个

开始:

1.将 apache-skywalking-apm-6.2.0.zip 解压并复制两份

2.配置skywalking-6.2.0_1/config/application.yml

core:
  default:
    # Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
    # Receiver: Receive agent data, Level 1 aggregate
    # Aggregator: Level 2 aggregate
    role: ${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
    restHost: ${SW_CORE_REST_HOST:0.0.0.0}
    restPort: ${SW_CORE_REST_PORT:12800}
    restContextPath: ${SW_CORE_REST_CONTEXT_PATH:/}
    gRPCHost: ${SW_CORE_GRPC_HOST:0.0.0.0}
    gRPCPort: ${SW_CORE_GRPC_PORT:11800}

gRPCHost、gRPCPort是agent发送数据的地址,restHost、restPort是ui请求的地址

nacos:
    serviceName: ${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
    hostPort: ${SW_CLUSTER_NACOS_HOST_PORT:localhost:8848}

配置多个Nacos cluster nodes, example: 10.0.0.1:8848,10.0.0.2:8848,10.0.0.3:8848

使用elasticsearch作为storage

storage:
  elasticsearch:
    nameSpace: ${SW_NAMESPACE:""}
    clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:localhost:9200}

启动默认检查索引若不存在则创建

配置skywalking-6.2.0_1/webapp/webapp.yml

collector:
  path: /graphql
  ribbon:
    ReadTimeout: 10000
    # Point to all backend's restHost:restPort, split by ,
    listOfServers: 127.0.0.1:12800,127.0.0.1:12801

配置所有的listOfServers

配置skywalking-6.2.0_1/agent/config/agent.config,增加

collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:127.0.0.1:11800,127.0.0.1:11801}

或者在启动jar包时设置如:
java -javaagent:./skywalking-6.2.0_1/agent/skywalking-agent.jar
-Dskywalking.agent.service_name=gateway
-Dskywalking.collector.backend_service=192.168.78.129:11800,192.168.78.129:11801
-jar sentinel-demo-spring-cloud-gateway-4.0.0.jar

spring-cloud-gateway应用需要将gateway的插件从optional-plugins移动到plugins下

启动:

启动一个skywalking-webapp.jar使用脚本webappService.sh
启动两个OAPServerStartUp使用脚本oapService.sh
启动一个gateway 使用命令java -javaagent:./skywalking-6.2.0_1/agent/skywalking-agent.jar -Dskywalking.agent.service_name=gateway -Dskywalking.collector.backend_service=192.168.78.129:11800,192.168.78.129:11801 -jar sentinel-demo-spring-cloud-gateway-4.0.0.jar

效果图:

skywalking配置nacos集群模式_第1张图片

skywalking配置nacos集群模式_第2张图片

skywalking配置nacos集群模式_第3张图片

skywalking配置nacos集群模式_第4张图片

你可能感兴趣的:(elasticsearch,运维,SpringCloud)