ES_JAVA_OPTS="-Xms128m -Xmx512m" 用于解决内存太小的问题
csharpdocker pull elasticsearch:7.8.0
docker run -d --name=es7 -p 9200:9200 -p 9300:9300 -e ES_JAVA_OPTS="-Xms128m -Xmx512m" -e "discovery.type=single-node" elasticsearch:7.8.0
csharpdocker pull apache/skywalking-oap-server:8.3.0-es7
docker run --name oap -d --restart=always -e TZ=Asia/Shanghai -p 12800:12800 -p 11800:11800 --link es7:es7 -e SW_STORAGE=elasticsearch7 -e SW_STORAGE_ES_CLUSTER_NODES=es7:9200 apache/skywalking-oap-server:8.3.0-es7
csharpdocker pull apache/skywalking-ui:8.3.0
docker run -d --name skywalking-ui --restart=always -e TZ=Asia/Shanghai -p 8080:8080 --link oap:oap -e SW_OAP_ADDRESS=oap:12800 apache/skywalking-ui:8.3.0
借用上篇文章 Net5 使用Ocelot+Consul
在Gateways
、App.Gateways
中加入包 SkyAPM.Agent.AspNetCore
,版本1.3.0
,同时加入skyapm.json
文件,并设置属性为较新则复制
launchSettings.json
中添加环境变量
csharp"SKYWALKING__SERVICENAME": "AppGateWay/ApiGateway",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "SkyAPM.Agent.AspNetCore"
csharp// Programs 文件
.ConfigureAppConfiguration(builder =>
{
builder.AddJsonFile("ocelot.json", false, true)
.AddJsonFile("skyapm.json", false, true);
})
json// Gateways
{
"SkyWalking": {
"ServiceName": "ApiGateWay",
"Namespace": "",
"HeaderVersions": [
"sw8"
],
"Sampling": {
"SamplePer3Secs": -1,
"Percentage": -1.0
},
"ServiceInstanceName": "ApiGateWay.001",
"Logging": {
"Level": "Information",
"FilePath": "logs\\skyapm-{Date}.log"
},
"Transport": {
"Interval": 3000,
"ProtocolVersion": "v8",
"QueueSize": 30000,
"BatchSize": 3000,
"gRPC": {
"Servers": "192.168.2.17:11800",
"Timeout": 10000,
"ConnectTimeout": 10000,
"ReportTimeout": 600000,
"Authentication": ""
}
}
}
}
// App.Gateways
{
"SkyWalking": {
"ServiceName": "AppGateWay",
"Namespace": "",
"HeaderVersions": [
"sw8"
],
"Sampling": {
"SamplePer3Secs": -1,
"Percentage": -1.0
},
"ServiceInstanceName": "ApiGateWay.002",
"Logging": {
"Level": "Information",
"FilePath": "logs\\skyapm-{Date}.log"
},
"Transport": {
"Interval": 3000,
"ProtocolVersion": "v8",
"QueueSize": 30000,
"BatchSize": 3000,
"gRPC": {
"Servers": "192.168.2.17:11800",
"Timeout": 10000,
"ConnectTimeout": 10000,
"ReportTimeout": 600000,
"Authentication": ""
}
}
}
}
本文作者:一叶知秋
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!