[英]Elastic APM Error | Google Kubernetes Engine
Am trying to run Elastic APM in GKE cluster.我正在尝试在 GKE 集群中运行 Elastic APM。 I have installed
elastic-search
, kibana
and apm-server
.我已经安装了
elastic-search
、 kibana
和apm-server
。 All services are up and running.所有服务都已启动并正在运行。 All these components has been through helm charts.
所有这些组件都通过了 helm 图表。 Below are the configuration for each component.
下面是每个组件的配置。
apmConfig:
apm-server.yml: |
apm-server:
host: "0.0.0.0:8200"
queue: {}
output.elasticsearch:
hosts: ["http://elasticsearch-master.monitoring.svc.cluster.local:9200"]
username: "elastic"
password: "password"
kibanaConfig:
kibana.yml: |
server.host: 0.0.0.0
server.port: 5601
elasticsearch.hosts: "http://elasticsearch-master.monitoring.svc.cluster.local:9200"
kibana.index: ".kibana"
server.basePath: "/kibana"
server.rewriteBasePath: true
server.publicBaseUrl: "https://mydomain/kibana"
elasticsearch:
username: "kibana_system"
password: "password"
I have tried to add APM integration to one of my service by using the below config:我尝试使用以下配置将 APM 集成添加到我的一项服务中:
var apm = require('elastic-apm-node').start({
// Override the service name from package.json
// Allowed characters: a-z, A-Z, 0-9, -, _, and space
serviceName: 'shopping',
// Use if APM Server requires a secret token
secretToken: '',
// Set the custom APM Server URL (default: http://localhost:8200)
serverUrl: 'https://mydomain/apm',
// Set the service environment
environment: 'production'
})
When I start the service, I get the below error in logs:当我启动服务时,我在日志中收到以下错误:
{"log.level":"error","@timestamp":"2022-08-18T10:08:31.584Z","log":{"logger":"elastic-apm-node"},"ecs":{"version":"1.6.0"},"message":"APM Server transport error (301): Unexpected APM Server response"}
301 - Moved permanently. 301 - 永久移动。 It would be great, if I could get any help?
如果我能得到任何帮助,那就太好了?
The problem have been solved.问题已解决。 The reason was because I was using a proxy and hitting port 80, while in the APM server service I was using port as 8200.
原因是我使用了代理并访问了 80 端口,而在 APM 服务器服务中我使用的是 8200 端口。
After changing the port to 80 and targetPort to 8200 value in apm server service, I was able to correctly instrument Elastic APM with my services.在 apm 服务器服务中将端口更改为 80 并将 targetPort 值更改为 8200 后,我能够使用我的服务正确地检测 Elastic APM。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.