版本
skywalking-oap-server:10.0.1
skywalking-ui: 10.0.1
elasticsearch: 7.16.3
banyandb: 0.6.1 (经过测试,发现还有有bug,改为成熟的ES存储)
nginx: 1.24.0
docker: 26.1.4
docker-compose: 2.28.1
docker镜像
需要的镜像:
elastic/elasticsearch:7.16.3
apache/skywalking-oap-server:10.0.1
apache/skywalking-ui:10.0.1
nginx:1.24.0
由于网络原因,如果下载不了,在可以下载的机器上把镜像导出,拷贝到目标机器,再在目标机器导入
镜像导出命令:
docker save -o /home/docker-images/nginx.1.24.0.tar nginx:1.24.0
镜像导入命令:
docker load -i /home/docker-images/nginx.1.24.0.tar
创建目录
mkdir -p /home/skywalking-quickstart/elasticsearch/data
mkdir -p /home/skywalking-quickstart/oap/config
mkdir -p /home/skywalking-quickstart/nginx
授权
chmod 777 -R /home/skywalking-quickstart/elasticsearch/data
oap自定义配置
文件位置:/home/skywalking-quickstart/oap/config/application.yml
application.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310
| cluster: selector: ${SW_CLUSTER:standalone} standalone: core: selector: ${SW_CORE:default} default: role: ${SW_CORE_ROLE:Mixed} restHost: ${SW_CORE_REST_HOST:0.0.0.0} restPort: ${SW_CORE_REST_PORT:12800} restContextPath: ${SW_CORE_REST_CONTEXT_PATH:/} restMaxThreads: ${SW_CORE_REST_MAX_THREADS:200} restIdleTimeOut: ${SW_CORE_REST_IDLE_TIMEOUT:30000} restAcceptQueueSize: ${SW_CORE_REST_QUEUE_SIZE:0} httpMaxRequestHeaderSize: ${SW_CORE_HTTP_MAX_REQUEST_HEADER_SIZE:8192} gRPCHost: ${SW_CORE_GRPC_HOST:0.0.0.0} gRPCPort: ${SW_CORE_GRPC_PORT:11800} maxConcurrentCallsPerConnection: ${SW_CORE_GRPC_MAX_CONCURRENT_CALL:0} maxMessageSize: ${SW_CORE_GRPC_MAX_MESSAGE_SIZE:0} gRPCThreadPoolSize: ${SW_CORE_GRPC_THREAD_POOL_SIZE:-1} gRPCSslEnabled: ${SW_CORE_GRPC_SSL_ENABLED:false} gRPCSslKeyPath: ${SW_CORE_GRPC_SSL_KEY_PATH:""} gRPCSslCertChainPath: ${SW_CORE_GRPC_SSL_CERT_CHAIN_PATH:""} gRPCSslTrustedCAPath: ${SW_CORE_GRPC_SSL_TRUSTED_CA_PATH:""} downsampling: - Hour - Day enableDataKeeperExecutor: ${SW_CORE_ENABLE_DATA_KEEPER_EXECUTOR:true} dataKeeperExecutePeriod: ${SW_CORE_DATA_KEEPER_EXECUTE_PERIOD:5} recordDataTTL: ${SW_CORE_RECORD_DATA_TTL:3} metricsDataTTL: ${SW_CORE_METRICS_DATA_TTL:7} l1FlushPeriod: ${SW_CORE_L1_AGGREGATION_FLUSH_PERIOD:500} storageSessionTimeout: ${SW_CORE_STORAGE_SESSION_TIMEOUT:70000} persistentPeriod: ${SW_CORE_PERSISTENT_PERIOD:25} topNReportPeriod: ${SW_CORE_TOPN_REPORT_PERIOD:10} activeExtraModelColumns: ${SW_CORE_ACTIVE_EXTRA_MODEL_COLUMNS:false} serviceNameMaxLength: ${SW_SERVICE_NAME_MAX_LENGTH:70} serviceCacheRefreshInterval: ${SW_SERVICE_CACHE_REFRESH_INTERVAL:10} instanceNameMaxLength: ${SW_INSTANCE_NAME_MAX_LENGTH:70} endpointNameMaxLength: ${SW_ENDPOINT_NAME_MAX_LENGTH:150} searchableTracesTags: ${SW_SEARCHABLE_TAG_KEYS:http.method,http.status_code,rpc.status_code,db.type,db.instance,mq.queue,mq.topic,mq.broker} searchableLogsTags: ${SW_SEARCHABLE_LOGS_TAG_KEYS:level,http.status_code} searchableAlarmTags: ${SW_SEARCHABLE_ALARM_TAG_KEYS:level} autocompleteTagKeysQueryMaxSize: ${SW_AUTOCOMPLETE_TAG_KEYS_QUERY_MAX_SIZE:100} autocompleteTagValuesQueryMaxSize: ${SW_AUTOCOMPLETE_TAG_VALUES_QUERY_MAX_SIZE:100} prepareThreads: ${SW_CORE_PREPARE_THREADS:2} enableEndpointNameGroupingByOpenapi: ${SW_CORE_ENABLE_ENDPOINT_NAME_GROUPING_BY_OPENAPI:true} syncPeriodHttpUriRecognitionPattern: ${SW_CORE_SYNC_PERIOD_HTTP_URI_RECOGNITION_PATTERN:10} trainingPeriodHttpUriRecognitionPattern: ${SW_CORE_TRAINING_PERIOD_HTTP_URI_RECOGNITION_PATTERN:60} maxHttpUrisNumberPerService: ${SW_CORE_MAX_HTTP_URIS_NUMBER_PER_SVR:3000} enableHierarchy: ${SW_CORE_ENABLE_HIERARCHY:true} storage: selector: ${SW_STORAGE:elasticsearch} elasticsearch: namespace: ${SW_NAMESPACE:""} clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:elasticsearch:9200} protocol: ${SW_STORAGE_ES_HTTP_PROTOCOL:"http"} 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:""} password: ${SW_ES_PASSWORD:""} trustStorePath: ${SW_STORAGE_ES_SSL_JKS_PATH:""} trustStorePass: ${SW_STORAGE_ES_SSL_JKS_PASS:""} secretsManagementFile: ${SW_ES_SECRETS_MANAGEMENT_FILE:""} dayStep: ${SW_STORAGE_DAY_STEP:1} indexShardsNumber: ${SW_STORAGE_ES_INDEX_SHARDS_NUMBER:1} indexReplicasNumber: ${SW_STORAGE_ES_INDEX_REPLICAS_NUMBER:1} specificIndexSettings: ${SW_STORAGE_ES_SPECIFIC_INDEX_SETTINGS:""} superDatasetDayStep: ${SW_STORAGE_ES_SUPER_DATASET_DAY_STEP:-1} superDatasetIndexShardsFactor: ${SW_STORAGE_ES_SUPER_DATASET_INDEX_SHARDS_FACTOR:5} superDatasetIndexReplicasNumber: ${SW_STORAGE_ES_SUPER_DATASET_INDEX_REPLICAS_NUMBER:0} indexTemplateOrder: ${SW_STORAGE_ES_INDEX_TEMPLATE_ORDER:0} bulkActions: ${SW_STORAGE_ES_BULK_ACTIONS:5000} batchOfBytes: ${SW_STORAGE_ES_BATCH_OF_BYTES:10485760} flushInterval: ${SW_STORAGE_ES_FLUSH_INTERVAL:5} concurrentRequests: ${SW_STORAGE_ES_CONCURRENT_REQUESTS:2} resultWindowMaxSize: ${SW_STORAGE_ES_QUERY_MAX_WINDOW_SIZE:10000} metadataQueryMaxSize: ${SW_STORAGE_ES_QUERY_MAX_SIZE:10000} scrollingBatchSize: ${SW_STORAGE_ES_SCROLLING_BATCH_SIZE:5000} segmentQueryMaxSize: ${SW_STORAGE_ES_QUERY_SEGMENT_SIZE:200} profileTaskQueryMaxSize: ${SW_STORAGE_ES_QUERY_PROFILE_TASK_SIZE:200} profileDataQueryBatchSize: ${SW_STORAGE_ES_QUERY_PROFILE_DATA_BATCH_SIZE:100} oapAnalyzer: ${SW_STORAGE_ES_OAP_ANALYZER:"{\"analyzer\":{\"oap_analyzer\":{\"type\":\"stop\"}}}"} oapLogAnalyzer: ${SW_STORAGE_ES_OAP_LOG_ANALYZER:"{\"analyzer\":{\"oap_log_analyzer\":{\"type\":\"standard\"}}}"} advanced: ${SW_STORAGE_ES_ADVANCED:""} logicSharding: ${SW_STORAGE_ES_LOGIC_SHARDING:false} enableCustomRouting: ${SW_STORAGE_ES_ENABLE_CUSTOM_ROUTING:false} agent-analyzer: selector: ${SW_AGENT_ANALYZER:default} default: traceSamplingPolicySettingsFile: ${SW_TRACE_SAMPLING_POLICY_SETTINGS_FILE:trace-sampling-policy-settings.yml} slowDBAccessThreshold: ${SW_SLOW_DB_THRESHOLD:default:200,mongodb:100} forceSampleErrorSegment: ${SW_FORCE_SAMPLE_ERROR_SEGMENT:true} segmentStatusAnalysisStrategy: ${SW_SEGMENT_STATUS_ANALYSIS_STRATEGY:FROM_SPAN_STATUS} noUpstreamRealAddressAgents: ${SW_NO_UPSTREAM_REAL_ADDRESS:6000,9000} meterAnalyzerActiveFiles: ${SW_METER_ANALYZER_ACTIVE_FILES:datasource,threadpool,satellite,go-runtime,python-runtime,continuous-profiling} slowCacheReadThreshold: ${SW_SLOW_CACHE_SLOW_READ_THRESHOLD:default:20,redis:10} slowCacheWriteThreshold: ${SW_SLOW_CACHE_SLOW_WRITE_THRESHOLD:default:20,redis:10}
log-analyzer: selector: ${SW_LOG_ANALYZER:default} default: lalFiles: ${SW_LOG_LAL_FILES:envoy-als,mesh-dp,mysql-slowsql,pgsql-slowsql,redis-slowsql,k8s-service,nginx,default} malFiles: ${SW_LOG_MAL_FILES:"nginx"}
event-analyzer: selector: ${SW_EVENT_ANALYZER:default} default:
receiver-sharing-server: selector: ${SW_RECEIVER_SHARING_SERVER:default} default: restHost: ${SW_RECEIVER_SHARING_REST_HOST:0.0.0.0} restPort: ${SW_RECEIVER_SHARING_REST_PORT:0} restContextPath: ${SW_RECEIVER_SHARING_REST_CONTEXT_PATH:/} restMaxThreads: ${SW_RECEIVER_SHARING_REST_MAX_THREADS:200} restIdleTimeOut: ${SW_RECEIVER_SHARING_REST_IDLE_TIMEOUT:30000} restAcceptQueueSize: ${SW_RECEIVER_SHARING_REST_QUEUE_SIZE:0} httpMaxRequestHeaderSize: ${SW_RECEIVER_SHARING_HTTP_MAX_REQUEST_HEADER_SIZE:8192} gRPCHost: ${SW_RECEIVER_GRPC_HOST:0.0.0.0} gRPCPort: ${SW_RECEIVER_GRPC_PORT:0} maxConcurrentCallsPerConnection: ${SW_RECEIVER_GRPC_MAX_CONCURRENT_CALL:0} maxMessageSize: ${SW_RECEIVER_GRPC_MAX_MESSAGE_SIZE:0} gRPCThreadPoolSize: ${SW_RECEIVER_GRPC_THREAD_POOL_SIZE:0} gRPCSslEnabled: ${SW_RECEIVER_GRPC_SSL_ENABLED:false} gRPCSslKeyPath: ${SW_RECEIVER_GRPC_SSL_KEY_PATH:""} gRPCSslCertChainPath: ${SW_RECEIVER_GRPC_SSL_CERT_CHAIN_PATH:""} gRPCSslTrustedCAsPath: ${SW_RECEIVER_GRPC_SSL_TRUSTED_CAS_PATH:""} authentication: ${SW_AUTHENTICATION:aacopy} receiver-register: selector: ${SW_RECEIVER_REGISTER:default} default:
receiver-trace: selector: ${SW_RECEIVER_TRACE:default} default:
receiver-jvm: selector: ${SW_RECEIVER_JVM:default} default:
receiver-clr: selector: ${SW_RECEIVER_CLR:default} default:
receiver-profile: selector: ${SW_RECEIVER_PROFILE:default} default:
receiver-zabbix: selector: ${SW_RECEIVER_ZABBIX:-}
service-mesh: selector: ${SW_SERVICE_MESH:default} default:
envoy-metric: selector: ${SW_ENVOY_METRIC:default} default: acceptMetricsService: ${SW_ENVOY_METRIC_SERVICE:true} alsHTTPAnalysis: ${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS:""} alsTCPAnalysis: ${SW_ENVOY_METRIC_ALS_TCP_ANALYSIS:""} k8sServiceNameRule: ${K8S_SERVICE_NAME_RULE:"${pod.metadata.labels.(service.istio.io/canonical-name)}.${pod.metadata.namespace}"} istioServiceNameRule: ${ISTIO_SERVICE_NAME_RULE:"${serviceEntry.metadata.name}.${serviceEntry.metadata.namespace}"} istioServiceEntryIgnoredNamespaces: ${SW_ISTIO_SERVICE_ENTRY_IGNORED_NAMESPACES:""} gRPCHost: ${SW_ALS_GRPC_HOST:0.0.0.0} gRPCPort: ${SW_ALS_GRPC_PORT:0} maxConcurrentCallsPerConnection: ${SW_ALS_GRPC_MAX_CONCURRENT_CALL:0} maxMessageSize: ${SW_ALS_GRPC_MAX_MESSAGE_SIZE:0} gRPCThreadPoolSize: ${SW_ALS_GRPC_THREAD_POOL_SIZE:0} gRPCSslEnabled: ${SW_ALS_GRPC_SSL_ENABLED:false} gRPCSslKeyPath: ${SW_ALS_GRPC_SSL_KEY_PATH:""} gRPCSslCertChainPath: ${SW_ALS_GRPC_SSL_CERT_CHAIN_PATH:""} gRPCSslTrustedCAsPath: ${SW_ALS_GRPC_SSL_TRUSTED_CAS_PATH:""}
kafka-fetcher: selector: ${SW_KAFKA_FETCHER:-}
receiver-meter: selector: ${SW_RECEIVER_METER:default} default:
receiver-otel: selector: ${SW_OTEL_RECEIVER:default} default: enabledHandlers: ${SW_OTEL_RECEIVER_ENABLED_HANDLERS:"otlp-metrics,otlp-logs"} enabledOtelMetricsRules: ${SW_OTEL_RECEIVER_ENABLED_OTEL_METRICS_RULES:"apisix,nginx/*,k8s/*,istio-controlplane,vm,mysql/*,postgresql/*,oap,aws-eks/*,windows,aws-s3/*,aws-dynamodb/*,aws-gateway/*,redis/*,elasticsearch/*,rabbitmq/*,mongodb/*,kafka/*,pulsar/*,bookkeeper/*,rocketmq/*,clickhouse/*,activemq/*"}
receiver-zipkin: selector: ${SW_RECEIVER_ZIPKIN:-}
receiver-browser: selector: ${SW_RECEIVER_BROWSER:default} default: sampleRate: ${SW_RECEIVER_BROWSER_SAMPLE_RATE:10000}
receiver-log: selector: ${SW_RECEIVER_LOG:default} default:
query: selector: ${SW_QUERY:graphql} graphql: enableLogTestTool: ${SW_QUERY_GRAPHQL_ENABLE_LOG_TEST_TOOL:false} maxQueryComplexity: ${SW_QUERY_MAX_QUERY_COMPLEXITY:3000} enableUpdateUITemplate: ${SW_ENABLE_UPDATE_UI_TEMPLATE:false} enableOnDemandPodLog: ${SW_ENABLE_ON_DEMAND_POD_LOG:false}
query-zipkin: selector: ${SW_QUERY_ZIPKIN:-}
promql: selector: ${SW_PROMQL:default} default: restHost: ${SW_PROMQL_REST_HOST:0.0.0.0} restPort: ${SW_PROMQL_REST_PORT:9090} restContextPath: ${SW_PROMQL_REST_CONTEXT_PATH:/} restMaxThreads: ${SW_PROMQL_REST_MAX_THREADS:200} restIdleTimeOut: ${SW_PROMQL_REST_IDLE_TIMEOUT:30000} restAcceptQueueSize: ${SW_PROMQL_REST_QUEUE_SIZE:0} buildInfoVersion: ${SW_PROMQL_BUILD_INFO_VERSION:"2.45.0"} buildInfoRevision: ${SW_PROMQL_BUILD_INFO_REVISION:""} buildInfoBranch: ${SW_PROMQL_BUILD_INFO_BRANCH:""} buildInfoBuildUser: ${SW_PROMQL_BUILD_INFO_BUILD_USER:""} buildInfoBuildDate: ${SW_PROMQL_BUILD_INFO_BUILD_DATE:""} buildInfoGoVersion: ${SW_PROMQL_BUILD_INFO_GO_VERSION:""}
logql: selector: ${SW_LOGQL:default} default: restHost: ${SW_LOGQL_REST_HOST:0.0.0.0} restPort: ${SW_LOGQL_REST_PORT:3100} restContextPath: ${SW_LOGQL_REST_CONTEXT_PATH:/} restMaxThreads: ${SW_LOGQL_REST_MAX_THREADS:200} restIdleTimeOut: ${SW_LOGQL_REST_IDLE_TIMEOUT:30000} restAcceptQueueSize: ${SW_LOGQL_REST_QUEUE_SIZE:0}
alarm: selector: ${SW_ALARM:default} default:
telemetry: selector: ${SW_TELEMETRY:none} none:
configuration: selector: ${SW_CONFIGURATION:none} none:
exporter: selector: ${SW_EXPORTER:-}
health-checker: selector: ${SW_HEALTH_CHECKER:-}
debugging-query: selector: ${SW_DEBUGGING_QUERY:default} default: keywords4MaskingSecretsOfConfig: ${SW_DEBUGGING_QUERY_KEYWORDS_FOR_MASKING_SECRETS:user,password,token,accessKey,secretKey,authentication}
configuration-discovery: selector: ${SW_CONFIGURATION_DISCOVERY:default} default: disableMessageDigest: ${SW_DISABLE_MESSAGE_DIGEST:false}
receiver-event: selector: ${SW_RECEIVER_EVENT:default} default:
receiver-ebpf: selector: ${SW_RECEIVER_EBPF:default} default: continuousPolicyCacheTimeout: ${SW_CONTINUOUS_POLICY_CACHE_TIMEOUT:60} gRPCHost: ${SW_EBPF_GRPC_HOST:0.0.0.0} gRPCPort: ${SW_EBPF_GRPC_PORT:0} maxConcurrentCallsPerConnection: ${SW_EBPF_GRPC_MAX_CONCURRENT_CALL:0} maxMessageSize: ${SW_EBPF_ALS_GRPC_MAX_MESSAGE_SIZE:0} gRPCThreadPoolSize: ${SW_EBPF_GRPC_THREAD_POOL_SIZE:0} gRPCSslEnabled: ${SW_EBPF_GRPC_SSL_ENABLED:false} gRPCSslKeyPath: ${SW_EBPF_GRPC_SSL_KEY_PATH:""} gRPCSslCertChainPath: ${SW_EBPF_GRPC_SSL_CERT_CHAIN_PATH:""} gRPCSslTrustedCAsPath: ${SW_EBPF_GRPC_SSL_TRUSTED_CAS_PATH:""}
receiver-telegraf: selector: ${SW_RECEIVER_TELEGRAF:default} default: activeFiles: ${SW_RECEIVER_TELEGRAF_ACTIVE_FILES:vm}
aws-firehose: selector: ${SW_RECEIVER_AWS_FIREHOSE:default} default: host: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_HOST:0.0.0.0} port: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_PORT:12801} contextPath: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_CONTEXT_PATH:/} maxThreads: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_MAX_THREADS:200} idleTimeOut: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_IDLE_TIME_OUT:30000} acceptQueueSize: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_ACCEPT_QUEUE_SIZE:0} maxRequestHeaderSize: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_MAX_REQUEST_HEADER_SIZE:8192} firehoseAccessKey: ${SW_RECEIVER_AWS_FIREHOSE_ACCESS_KEY:} enableTLS: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_ENABLE_TLS:false} tlsKeyPath: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_TLS_KEY_PATH:} tlsCertChainPath: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_TLS_CERT_CHAIN_PATH:}
ai-pipeline: selector: ${SW_AI_PIPELINE:default} default: uriRecognitionServerAddr: ${SW_AI_PIPELINE_URI_RECOGNITION_SERVER_ADDR:} uriRecognitionServerPort: ${SW_AI_PIPELINE_URI_RECOGNITION_SERVER_PORT:17128}
|
文件位置:/home/skywalking-quickstart/oap/config/alarm-settings.yml
alarm-settings.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| rules: service_resp_time_rule: expression: sum(service_resp_time > 1000) >= 3 period: 10 silence-period: 5 message: Response time of service {name} is more than 1000ms in 3 minutes of last 10 minutes. service_sla_rule: expression: sum(service_sla < 8000) >= 2 period: 10 silence-period: 3 message: Successful rate of service {name} is lower than 80% in 2 minutes of last 10 minutes service_resp_time_percentile_rule: expression: sum(service_percentile{p='50,75,90,95,99'} > 1000) >= 3 period: 10 silence-period: 5 message: Percentile response time of service {name} alarm in 3 minutes of last 10 minutes, due to more than one condition of p50 > 1000, p75 > 1000, p90 > 1000, p95 > 1000, p99 > 1000 service_instance_resp_time_rule: expression: sum(service_instance_resp_time > 1000) >= 2 period: 10 silence-period: 5 message: Response time of service instance {name} is more than 1000ms in 2 minutes of last 10 minutes database_access_resp_time_rule: expression: sum(database_access_resp_time > 1000) >= 2 period: 10 message: Response time of database access {name} is more than 1000ms in 2 minutes of last 10 minutes endpoint_relation_resp_time_rule: expression: sum(endpoint_relation_resp_time > 1000) >= 2 period: 10 message: Response time of endpoint relation {name} is more than 1000ms in 2 minutes of last 10 minutes
|
nginx配置
官方声明:SkyWalking 多年来一直不提供常规的登录和身份验证。如果你需要,很多 Gateway 解决方案都提供了完善的解决方案,例如 Nginx 生态系统。
通过nginx,增加ui的访问账号和密码
docker-compose中把不必要的端口全部关掉
htpasswd
是用于管理用户和密码的工具
yum install -y httpd-tools
创建密钥文件
htpasswd -c /home/skywalking-quickstart/nginx/.htpasswd admin
文件位置:/home/skywalking-quickstart/nginx/nginx.conf
nginx.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| worker_processes 1;
events { worker_connections 1024; }
http { include mime.types; default_type application/octet-stream;
sendfile on; keepalive_timeout 65; server { listen 8000; server_name skywalking;
location / { auth_basic "SkyWalking"; auth_basic_user_file /etc/nginx/.htpasswd; proxy_pass http://skywalking-ui:8080; } } }
|
docker-compose
文件位置:/home/skywalking-quickstart/docker-compose.yml
docker-compose.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
| version: '3.8' services: elasticsearch: image: elastic/elasticsearch:7.16.3 container_name: skywalking-elasticsearch restart: always networks: - skywalking healthcheck: test: [ "CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1" ] interval: 30s timeout: 10s retries: 3 start_period: 10s environment: - TZ=Asia/Shanghai - discovery.type=single-node - bootstrap.memory_lock=true - "ES_JAVA_OPTS=-Xms4096m -Xmx4096m" - thread_pool.write.queue_size=1000 volumes: - ./elasticsearch/data:/usr/share/elasticsearch/data ulimits: memlock: soft: -1 hard: -1
oap: image: apache/skywalking-oap-server:10.0.1 container_name: skywalking-oap-server restart: always ports: - "11800:11800" networks: - skywalking healthcheck: test: [ "CMD-SHELL", "curl http://localhost:12800/internal/l7check" ] interval: 30s timeout: 10s retries: 5 start_period: 10s depends_on: elasticsearch: condition: service_healthy environment: TZ: Asia/Shanghai JAVA_OPTS: "-Xms4096m -Xmx4096m" volumes: - ./oap/config/application.yml:/skywalking/config/application.yml - ./oap/config/alarm-settings.yml:/skywalking/config/alarm-settings.yml
ui: image: apache/skywalking-ui:10.0.1 container_name: skywalking-ui restart: always networks: - skywalking healthcheck: test: [ "CMD-SHELL", "curl --silent --fail http://localhost:8080/ || exit 1" ] interval: 30s timeout: 10s retries: 5 start_period: 10s depends_on: oap: condition: service_healthy environment: TZ: Asia/Shanghai SW_OAP_ADDRESS: http://skywalking-oap-server:12800 SW_ZIPKIN_ADDRESS: http://skywalking-oap-server:9412 nginx: image: nginx:1.24.0 container_name: skywalking-nginx restart: always ports: - "8000:8000" networks: - skywalking volumes: - ./nginx/.htpasswd:/etc/nginx/.htpasswd - ./nginx/nginx.conf:/etc/nginx/nginx.conf depends_on: ui: condition: service_healthy environment: TZ: Asia/Shanghai
networks: skywalking:
|
启动docker compose
docker compose --project-name=skywalking-quickstart up -d --wait
停止并删除容器
docker compose --project-name=skywalking-quickstart down
Java Agent
Java Agent下载:https://skywalking.apache.org/downloads/
版本:9.3.0
添加jvm参数
-javaagent:D:\tools\skywalking-agent\skywalking-agent.jar -Dskywalking.agent.service_name=test -Dskywalking.collector.backend_service=192.168.56.128:11800 -Dskywalking.agent.authentication=aacopy
如何编译源码
https://github.com/apache/skywalking-java/blob/main/docs/en/contribution/compiling.md