如何在 jboss 7.4.17 容器上安装 appdynamics 代理...?

问题描述 投票:0回答:1

今天我开始了一个玩jboss的任务,我拉了最新的容器并尝试让appdynamics正确安装......

registry.redhat.io/jboss-eap-7/eap74-openjdk8-openshift-rhel8:7.4.17-6.1721256395

但是,使用默认配置,我无法安装代理并且不断收到错误

JBoss Bootstrap Environment

  JBOSS_HOME: /opt/eap

  JAVA: /opt/java/bin/java

  JAVA_OPTS:  -server -verbose:gc -Xloggc:"/opt/eap/standalone/log/gc.log" -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=3M -XX:-TraceClassUnloading -Djdk.serialFilter="maxbytes=10485760;maxdepth=128;maxarray=100000;maxrefs=300000"  -Xms2048m -Xmx2048m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.security.krb5.debug=true -Dsun.security.spnego.debug=true  -Djava.awt.headless=true -Djboss.bind.address=0.0.0.0 -Djboss.bind.address.management=0.0.0.0 -Djboss.socket.binding.port-offset=0 -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2 -Djboss.tx.node.id=192.168.63.123 -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager,com.singularity -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:/opt/eap/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-2.1.18.Final-redhat-00001.jar -Xbootclasspath/p:/opt/eap/jboss-modules.jar 

=========================================================================

Listening for transport dt_socket at address: 8787
java.lang.NoClassDefFoundError: org/wildfly/common/net/HostName
    at org.jboss.logmanager.ExtLogRecord.<init>(ExtLogRecord.java:87)
    at org.jboss.logmanager.Logger.log(Logger.java:798)
    at org.jboss.logging.JBossLogManagerLogger.doLogf(JBossLogManagerLogger.java:53)
    at org.jboss.logging.Logger.logf(Logger.java:2398)
    at org.jboss.msc.service.ServiceLogger_$logger.greeting(ServiceLogger_$logger.java:41)

在互联网上研究其他人如何解决问题后,我已将此信息添加到standalone.conf 文件的底部。

JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager,com.singularity" 
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$(ls ${JBOSS_HOME}/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-*.jar)"
# JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$(ls ${JBOSS_HOME}/modules/system/layers/base/org/wildfly/common/main/wildfly-common-*.jar)"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$JBOSS_HOME/jboss-modules.jar"

无论出于何种原因,该条目似乎没有被选中......?

JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager"

从网上的评论来看,这个问题已经存在了一段时间了。有人能够在 docker 镜像上安装这个代理吗?

他,

X

附注在 redhat 的原始映像之外,我仅将 4 行添加到standalone.conf 文件 (/opt/eap/bin/standalone.conf) 的底部。没有任何应用程序或其他任何内容被修改...

jboss openshift appdynamics
1个回答
0
投票

所以,jboss 不会从容器中读取环境变量...我必须像这样将映射添加到独立配置文件中...

部署.yml

containers:
  - resources:
      limits:
        cpu: '8'
        memory: 24Gi
      requests:
        cpu: 50m
        memory: 1Gi
    name: jboss7-4
    command:
      - /bin/bash
      - '-c'
    args:
      - /opt/eap/bin/openshift-launch.sh
    env:
      - name: APPDYNAMICS_ENABLED
        value: 'true'
      - name: APPDYNAMICS_CONTROLLER_PORT
        value: '443'
      - name: APPDYNAMICS_CONTROLLER_SSL_ENABLED
        value: 'true'
      - name: APPDYNAMICS_DEBUG
        value: 'true'
      - name: APPDYNAMICS_AGENT_NODE_NAME
        valueFrom:
          fieldRef:
            apiVersion: v1
            fieldPath: metadata.name
      - name: APPDYNAMICS_AGENT_TIER_NAME
        value: web
      - name: JAVA_OPTIONS
        value: '-javaagent:/appd/appdynamics/javaagent.jar'
      - name: APPDYNAMICS_AGENT_ACCOUNT_NAME
        value: xxxxxx
      - name: APPDYNAMICS_CONTROLLER_HOST_NAME
        value: xxxxx.saas.appdynamics.com
      - name: APPDYNAMICS_AGENT_APPLICATION_NAME
        value: DEV

独立.conf


# Enable logging settigns
JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager,com.singularity" 
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$(ls ${JBOSS_HOME}/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-*.jar)"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$(ls ${JBOSS_HOME}/modules/system/layers/base/org/wildfly/common/main/wildfly-common-*.jar)"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$JBOSS_HOME/jboss-modules.jar"

# Configure AppDynamis options as openshift vars are not being read.
JAVA_OPTS="$JAVA_OPTS -javaagent:/appd/appdynamics/javaagent.jar" 
JAVA_OPTS="$JAVA_OPTS -Djavax.net.ssl.trustStore=/usr/lib/jvm/java-1.8.0/jre/lib/security/cacerts"
JAVA_OPTS="$JAVA_OPTS -Djavax.net.ssl.trustStoreType=JKS -Dserver.port=8080"
#
JAVA_OPTS="$JAVA_OPTS -Dappdynamics.aws.instance.enabled=$APPDYNAMICS_ENABLED"
# JAVA_OPTS="$JAVA_OPTS -Dappdynamics.agent.reuse.nodeName.prefix=$APPDYNAMICS_JAVA_AGENT_REUSE_NODE_NAME"
# APPDYNAMICS_DEBUG
JAVA_OPTS="$JAVA_OPTS -Dappdynamics.controller.hostName=$APPDYNAMICS_CONTROLLER_HOST_NAME"
JAVA_OPTS="$JAVA_OPTS -Dappdynamics.controller.port=$APPDYNAMICS_CONTROLLER_PORT"
JAVA_OPTS="$JAVA_OPTS -Dappdynamics.controller.ssl.enabled=$APPDYNAMICS_CONTROLLER_SSL_ENABLED"
#
JAVA_OPTS="$JAVA_OPTS -Dappdynamics.agent.applicationName=$APPDYNAMICS_AGENT_APPLICATION_NAME"
JAVA_OPTS="$JAVA_OPTS -Dappdynamics.agent.tierName=$APPDYNAMICS_AGENT_TIER_NAME"
JAVA_OPTS="$JAVA_OPTS -Dappdynamics.agent.nodeName=$APPDYNAMICS_AGENT_NODE_NAME"
#
JAVA_OPTS="$JAVA_OPTS -Dappdynamics.agent.accountName=$APPDYNAMICS_AGENT_ACCOUNT_NAME"
JAVA_OPTS="$JAVA_OPTS -Dappdynamics.agent.accountAccessKey=$APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY"

因为jboss是在进程空间中运行的,所以我们需要在启动jboss时引入变量...一旦这样做,您就可以开始了...

© www.soinside.com 2019 - 2024. All rights reserved.