java - 使用 AccessControlException 拒绝 Elastic APM 代理访问
问题描述
我正在为 sonarqube 实现 apm 代理,我可以使用 curl 连接到 apm 服务器
curl -v "" 返回 200
命令:
sudo java -jar apm-agent-attach-standalone.jar --include '. 声纳。' ---config config_file=elasticapm.properties
命令输出:
它显示代理已附加
日志文件:
java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "getClassLoader")
at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
at java.base/java.security.AccessController.checkPermission(AccessController.java:897)
at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:322)
at java.base/java.lang.Class.forName(Class.java:393)
at co.elastic.apm.agent.premain.AgentMain.loadAndInitializeAgent(AgentMain.java:174)
at co.elastic.apm.agent.premain.AgentMain.init(AgentMain.java:122)
at co.elastic.apm.agent.premain.AgentMain.agentmain(AgentMain.java:67)
at jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:535)
2021-04-21 11:11:55,561 [elastic-apm-server-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Error trying to connect to APM Server. Some details about SSL configurations corresponding the current connection are logged at INFO level.
2021-04-21 11:11:55,561 [elastic-apm-server-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Failed to handle event of type JSON_WRITER with this error: Connection refused (Connection refused)
2021-04-21 11:11:55,561 [elastic-apm-server-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 36 seconds (+/-10%)
2021-04-21 11:11:55,709 [elastic-apm-configuration-reloader] WARN co.elastic.apm.agent.shaded.stagemonitor.configuration.ConfigurationOption - Error in Attachment configuration: no protocol: 8200 Default value 'http://localhost:8200' for 'server_url' will be applied.
2021-04-21 11:11:56,176 [elastic-apm-server-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Error trying to connect to APM Server. Some details about SSL configurations corresponding the current connection are logged at INFO level.
询问:
它显示访问被拒绝异常......如何解决这个问题?
注意: 对于 server_url,我尝试使用属性文件 --config server_url, --args server_url 这通常可以工作
elasticapm.properties:
service_name=sonar-service
server_url=https://elk:8200
log_file=/var/log/elastic-apm.log
解决方案
推荐阅读
- html - 什么会导致 CSS 文本装饰线(下划线)在 Google Chrome 中出现分裂?
- spring - AnnotationConfigApplicationContext 参数
- javascript - 未捕获的错误:[$injector:modulerr] 错误:[$injector:nomod] 模块“chart.js”不可用
- python - Python YAML 到 JSON 到 YAML
- amazon-s3 - 无法使用 SSE-KMS 加密(使用 .NET SDK)对 S3 存储桶进行分段上传
- c - 带有两个约束的链表插入
- python-pptx - python pptx PowerPoint幻灯片构建——理解模式/构建方法的麻烦
- html - 响应式表头未显示
- python - 如何使用蓝图在 Flask 中提供静态文件
- dialogflow-es - 服务器上的 Dialogflow 实体列表