skywalking调用链跟踪系统安装

skywalking调用链跟踪系统安装

标签: 监控   调用链跟踪  

skywalking调用链跟踪安装

安装docker略

安装ES数据库

docker run -e ES_JAVA_OPTS="-Xms8G -Xmx8G" -d --name ES1 -p 9200:9200 -p 9300:9300 -v /data/es/es.yml:/usr/share/elasticsearch/config/elasticsearch.yml -v /data/esdata:/usr/share/elasticsearch/data -v /usr/conf/elasticsearch/elasticsearch:/usr/share/elasticsearch/plugins --privileged=true elasticsearch:6.4.2

增加相应文件夹和权限

ES配置文件

[root@XKskywalking data]# cat es/es.yml 
#集群名
cluster.name: skywalking 
 
#节点名
node.name: node-120-1
 
#设置绑定的ip地址,可以是ipv4或ipv6的,默认为0.0.0.0,
#指绑定这台机器的任何一个ip
network.bind_host: 0.0.0.0
 
#设置其它节点和该节点交互的ip地址,如果不设置它会自动判断,
#值必须是个真实的ip地址  
network.publish_host: 10.3.201.120
 
#设置对外服务的http端口,默认为9200
http.port: 9200
 
#设置节点之间交互的tcp端口,默认是9300
transport.tcp.port: 9300
 
#是否允许跨域REST请求
http.cors.enabled: true
 
#允许 REST 请求来自何处
http.cors.allow-origin: "*"
 
#节点角色设置
node.master: true 
node.data: true
 
#有成为主节点资格的节点列表
#discovery.zen.ping.unicast.hosts: ["0.0.0.0:9300","0.0.0.0:9301","0.0.0.0:9302"]
discovery.zen.ping.unicast.hosts: ["10.3.201.120:9300","10.3.201.121:9300"]
 
#集群中一直正常运行的,有成为master节点资格的最少节点数(默认为1)
# (totalnumber of master-eligible nodes / 2 + 1) 
discovery.zen.minimum_master_nodes: 1 
xpack.security.enabled: false

安装SKYWAKING服务端

安装jdk,官网下载skywalking最新版。 修改配置文件为ES存储,启动访问8080端口

[root@XKskywalking apache-skywalking-apm-bin]# grep -v "^#" config/application.yml        

cluster:
  standalone:
  # Please check your ZooKeeper is 3.5+, However, it is also compatible with ZooKeeper 3.4.x. Replace the ZooKeeper 3.5+
  # library the oap-libs folder with your ZooKeeper 3.4.x library.
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}
    downsampling:
      - Hour
      - Day
      - Month
    # Set a timeout on metrics data. After the timeout has expired, the metrics data will automatically be deleted.
    enableDataKeeperExecutor: ${SW_CORE_ENABLE_DATA_KEEPER_EXECUTOR:true} # Turn it off then automatically metrics data delete will be close.
    recordDataTTL: ${SW_CORE_RECORD_DATA_TTL:90} # Unit is minute
    minuteMetricsDataTTL: ${SW_CORE_MINUTE_METRIC_DATA_TTL:90} # Unit is minute
    hourMetricsDataTTL: ${SW_CORE_HOUR_METRIC_DATA_TTL:36} # Unit is hour
    dayMetricsDataTTL: ${SW_CORE_DAY_METRIC_DATA_TTL:45} # Unit is day
    monthMetricsDataTTL: ${SW_CORE_MONTH_METRIC_DATA_TTL:18} # Unit is month
    # Cache metric data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute,
    # the metrics may not be accurate within that minute.
    enableDatabaseSession: ${SW_CORE_ENABLE_DATABASE_SESSION:true}
storage:
   elasticsearch:
     clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:localhost:9200}
     indexShardsNumber: ${SW_STORAGE_ES_INDEX_SHARDS_NUMBER:2}
     indexReplicasNumber: ${SW_STORAGE_ES_INDEX_REPLICAS_NUMBER:0}
     bulkActions: ${SW_STORAGE_ES_BULK_ACTIONS:1000} # Execute the bulk every 1000 requests
     flushInterval: ${SW_STORAGE_ES_FLUSH_INTERVAL:10} # flush the bulk every 10 seconds whatever the number of requests
     concurrentRequests: ${SW_STORAGE_ES_CONCURRENT_REQUESTS:2} # the number of concurrent requests
receiver-sharing-server:
  default:
receiver-register:
  default:
receiver-trace:
  default:
    bufferPath: ${SW_RECEIVER_BUFFER_PATH:../trace-buffer/}  # Path to trace buffer files, suggest to use absolute path
    bufferOffsetMaxFileSize: ${SW_RECEIVER_BUFFER_OFFSET_MAX_FILE_SIZE:100} # Unit is MB
    bufferDataMaxFileSize: ${SW_RECEIVER_BUFFER_DATA_MAX_FILE_SIZE:500} # Unit is MB
    bufferFileCleanWhenRestart: ${SW_RECEIVER_BUFFER_FILE_CLEAN_WHEN_RESTART:false}
    sampleRate: ${SW_TRACE_SAMPLE_RATE:10000} # The sample rate precision is 1/10000. 10000 means 100% sample in default.
    slowDBAccessThreshold: ${SW_SLOW_DB_THRESHOLD:default:200,mongodb:100} # The slow database access thresholds. Unit ms.
receiver-jvm:
  default:
receiver-clr:
  default:
service-mesh:
  default:
    bufferPath: ${SW_SERVICE_MESH_BUFFER_PATH:../mesh-buffer/}  # Path to trace buffer files, suggest to use absolute path
    bufferOffsetMaxFileSize: ${SW_SERVICE_MESH_OFFSET_MAX_FILE_SIZE:100} # Unit is MB
    bufferDataMaxFileSize: ${SW_SERVICE_MESH_BUFFER_DATA_MAX_FILE_SIZE:500} # Unit is MB
    bufferFileCleanWhenRestart: ${SW_SERVICE_MESH_BUFFER_FILE_CLEAN_WHEN_RESTART:false}
istio-telemetry:
  default:
envoy-metric:
  default:
query:
  graphql:
    path: ${SW_QUERY_GRAPHQL_PATH:/graphql}
alarm:
  default:
telemetry:
  none:
configuration:
  none:

安装skywalking客户端

拷贝agent目录到相应工程的服务器指定目录上,并修改配置文件。

root@app76:/hlz$grep -v '^#' /opt/skywalking_agent/config/agent.config |grep -v '^$'
agent.service_name=${SW_AGENT_NAME:hlz77}
collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:10.4.31.170:11800}
logging.file_name=${SW_LOGGING_FILE_NAME:skywalking-api.log}
logging.level=${SW_LOGGING_LEVEL:DEBUG}

jar包启动方式 java -javaagent:/opt/agent/skywalking-agent.jar -jar *.jar

tomcat启动方式 修改catalina.sh,添加一句,注意不要有冲突。

root@app76:/hlz$head tomcat-hlz-9093/bin/catalina.sh      
#!/bin/sh
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/opt/skywalking_agent/skywalking-agent.jar"; export CATALINA_OPTS

application.yml中修改存储时长recordDataTTL: ${SW_STORAGE_ES_RECORD_DATA_TTL:30} # Unit is day

「真诚赞赏,手留余香」

Uwei

请我喝杯咖啡?

使用微信扫描二维码完成支付

相关文章