mingregister opened a new issue #33:
URL: https://github.com/apache/rocketmq-exporter/issues/33


   I build this image with this Dockerfile:
   `FROM java:8
   COPY rocketmq-exporter-0.0.2-SNAPSHOT.jar 
rocketmq-exporter-0.0.2-SNAPSHOT.jar
   COPY startup.sh /startup.sh
   EXPOSE 5557
   ENTRYPOINT ["/startup.sh"]`
   
   where the /startup.sh is:
   `
   #!/bin/sh 
   echo "JAVA_OPTS is: $JAVA_OPTS"
   echo "MQ_OPTS is: $MQ_OPTS"
   exec java -jar rocketmq-exporter-0.0.2-SNAPSHOT.jar $JAVA_OPTS $MQ_OPTS
   `
   
   
   ### Deployment yaml
   `
   apiVersion: apps/v1
   kind: Deployment
   metadata:
     labels:
       app: rocketmqexporter
     name: rocketmqexporter
     namespace: default
   spec:
     progressDeadlineSeconds: 600
     replicas: 1
     revisionHistoryLimit: 10
     selector:
       matchLabels:
         app: rocketmqexporter
     strategy:
       rollingUpdate:
         maxSurge: 1
         maxUnavailable: 0
       type: RollingUpdate
     template:
       metadata:
         labels:
           app: rocketmqexporter
       spec:
         containers:
         - name: rocketmqexporter
           env:
           - name: RESTART_
             value: "1595446822"
           - name: JAVA_OPTS
             value: '-XX:+HeapDumpOnOutOfMemoryError 
-XX:HeapDumpPath=/tmp/oom.log  -XX:+PrintGCDetails -XX:+PrintGCTimeStamps 
-XX:+PrintGCDateStamps -Xloggc:./gc.log'
           - name: MQ_OPTS
             value: '--rocketmq.config.namesrvAddr="192.168.0.144:9876 
--logging.level.org.springframework.context=DEBUG"'
           image: 
registry.cn-shenzhen.aliyuncs.com/zmhuangpub/rocketmq-exporter:0.0.1
           imagePullPolicy: Always
           terminationMessagePath: /dev/termination-log
           terminationMessagePolicy: File
         dnsPolicy: ClusterFirst
         restartPolicy: Always
         schedulerName: default-scheduler
         serviceAccount: default
         serviceAccountName: default
         terminationGracePeriodSeconds: 30
   `
   
   ### startup log
   `JAVA_OPTS is: -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/oom.log 
 -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps 
-Xloggc:./gc.log
   MQ_OPTS is: --rocketmq.config.namesrvAddr="192.168.0.144:9876 
--logging.level.org.springframework.context=DEBUG"
   [2020-09-24 04:01:50.777] ERROR Cannot set level 'DEBUG"' for 
'org.springframework.context'
   
     .   ____          _            __ _ _
    /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
   ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
    \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
     '  |____| .__|_| |_|_| |_\__, | / / / /
    =========|_|==============|___/=/_/_/_/
    :: Spring Boot ::        (v2.1.2.RELEASE)
   
   [2020-09-24 04:01:50.945]  INFO Starting RocketMQExporterApplication 
v0.0.2-SNAPSHOT on rocketmqexporter-b75f65f94-jpkrj with PID 1 
(/rocketmq-exporter-0.0.2-SNAPSHOT.jar started by root in /)
   [2020-09-24 04:01:50.948]  INFO No active profile set, falling back to 
default profiles: default
   [2020-09-24 04:01:52.914]  INFO Tomcat initialized with port(s): 5557 (http)
   [2020-09-24 04:01:52.957]  INFO Initializing ProtocolHandler 
["http-nio-5557"]
   [2020-09-24 04:01:52.985]  INFO Starting service [Tomcat]
   [2020-09-24 04:01:52.985]  INFO Starting Servlet engine: [Apache 
Tomcat/9.0.14]
   [2020-09-24 04:01:53.002]  INFO The APR based Apache Tomcat Native library 
which allows optimal performance in production environments was not found on 
the java.library.path: 
[/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib]
   [2020-09-24 04:01:53.132]  INFO Initializing Spring embedded 
WebApplicationContext
   [2020-09-24 04:01:53.132]  INFO Root WebApplicationContext: initialization 
completed in 2083 ms
   [2020-09-24 04:01:53.230]  INFO setNameSrvAddrByProperty 
nameSrvAddr="192.168.0.144:9876
   [2020-09-24 04:01:53.234]  INFO setWebTelemetryPath webTelemetryPath=/metrics
   [2020-09-24 04:01:53.235]  INFO setRocketmqVersion rocketmqVersion=420
   [2020-09-24 04:01:53.683]  INFO MetricsCollectTask init starting....
   [2020-09-24 04:01:56.684]  WARN Exception encountered during context 
initialization - cancelling refresh attempt: 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'metricsCollectTask': Invocation of init method failed; nested 
exception is org.apache.rocketmq.remoting.exception.RemotingConnectException: 
connect to <null> failed
   [2020-09-24 04:01:56.698]  INFO Stopping service [Tomcat]
   [2020-09-24 04:01:56.713]  INFO 
   
   Error starting ApplicationContext. To display the conditions report re-run 
your application with 'debug' enabled.
   [2020-09-24 04:01:56.717] ERROR Application run failed
   org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'metricsCollectTask': Invocation of init method failed; nested 
exception is org.apache.rocketmq.remoting.exception.RemotingConnectException: 
connect to <null> failed
        at 
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:139)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:419)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1737)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:846)
        at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863)
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
        at 
org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
        at 
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
        at 
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
        at 
org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
        at 
org.apache.rocketmq.exporter.RocketMQExporterApplication.main(RocketMQExporterApplication.java:29)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at 
org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
   Caused by: org.apache.rocketmq.remoting.exception.RemotingConnectException: 
connect to <null> failed
        at 
org.apache.rocketmq.remoting.netty.NettyRemotingClient.invokeSync(NettyRemotingClient.java:392)
        at 
org.apache.rocketmq.client.impl.MQClientAPIImpl.getBrokerClusterInfo(MQClientAPIImpl.java:1180)
        at 
org.apache.rocketmq.tools.admin.DefaultMQAdminExtImpl.examineBrokerClusterInfo(DefaultMQAdminExtImpl.java:275)
        at 
org.apache.rocketmq.tools.admin.DefaultMQAdminExt.examineBrokerClusterInfo(DefaultMQAdminExt.java:222)
        at 
org.apache.rocketmq.exporter.service.client.MQAdminExtImpl.examineBrokerClusterInfo(MQAdminExtImpl.java:197)
        at 
org.apache.rocketmq.exporter.task.MetricsCollectTask.init(MetricsCollectTask.java:121)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at 
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:363)
        at 
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:307)
        at 
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)
   `
   
   ### kubernetes cluster-info 
   Kubernetes master is running at https://192.168.0.146:6443
   KubeDNS is running at 
https://192.168.0.146:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
   Metrics-server is running at 
https://192.168.0.146:6443/api/v1/namespaces/kube-system/services/https:metrics-server:/proxy
   
   
   ### kernel info(uname -a)
   Linux xxxxx 4.15.0-96-generic #97-Ubuntu SMP Wed Apr 1 03:25:46 UTC 2020 
x86_64 x86_64 x86_64 GNU/Linux
   
   
   ### docker info 
   `
   Client:
    Debug Mode: false
   
   Server:
    Containers: 177
     Running: 167
     Paused: 0
     Stopped: 10
    Images: 4966
    Server Version: 19.03.6
    Storage Driver: overlay2
     Backing Filesystem: extfs
     Supports d_type: true
     Native Overlay Diff: true
    Logging Driver: json-file
    Cgroup Driver: systemd
    Plugins:
     Volume: local
     Network: bridge host ipvlan macvlan null overlay
     Log: awslogs fluentd gcplogs gelf journald json-file local logentries 
splunk syslog
    Swarm: inactive
    Runtimes: runc
    Default Runtime: runc
    Init Binary: docker-init
    containerd version: 
    runc version: 
    init version: 
    Security Options:
     apparmor
     seccomp
      Profile: default
    Kernel Version: 4.15.0-96-generic
    Operating System: Ubuntu 18.04.4 LTS
    OSType: linux
    Architecture: x86_64
    CPUs: 20
    Total Memory: 62.85GiB
    Name: xxxx
    ID: QQCS:UEBA:PERO:EFOO:GKHD:HIGG:IQ6G:W7QR:NQ5G:N7NY:EOIY:5474
    Docker Root Dir: /data/lib/docker
    Debug Mode: false
    Registry: https://index.docker.io/v1/
    Labels:
    Experimental: false
    Insecure Registries:
     xxxx:32000
     dockerhub.office.xxxxx.com:443
     127.0.0.0/8
    Registry Mirrors:
     https://bvp31fna.mirror.aliyuncs.com/
     https://registry.docker-cn.com/
     https://dockerhub.office.xxxxx.com/
    Live Restore Enabled: true
   `
   
   if I run in vm, this can be startup。
   `
   
     .   ____          _            __ _ _
    /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
   ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
    \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
     '  |____| .__|_| |_|_| |_\__, | / / / /
    =========|_|==============|___/=/_/_/_/
    :: Spring Boot ::        (v2.1.2.RELEASE)
   
   [2020-09-24 12:22:01.692]  INFO Starting RocketMQExporterApplication 
v0.0.2-SNAPSHOT on company-server with PID 27957 
(/tmp/rocketmq-exporter-0.0.2-SNAPSHOT.jar started by root in /tmp)
   [2020-09-24 12:22:01.695]  INFO No active profile set, falling back to 
default profiles: default
   [2020-09-24 12:22:02.470]  INFO Tomcat initialized with port(s): 5557 (http)
   [2020-09-24 12:22:02.481]  INFO Initializing ProtocolHandler 
["http-nio-5557"]
   [2020-09-24 12:22:02.488]  INFO Starting service [Tomcat]
   [2020-09-24 12:22:02.488]  INFO Starting Servlet engine: [Apache 
Tomcat/9.0.14]
   [2020-09-24 12:22:02.495]  INFO The APR based Apache Tomcat Native library 
which allows optimal performance in production environments was not found on 
the java.library.path: 
[/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
   [2020-09-24 12:22:02.539]  INFO Initializing Spring embedded 
WebApplicationContext
   [2020-09-24 12:22:02.539]  INFO Root WebApplicationContext: initialization 
completed in 815 ms
   [2020-09-24 12:22:02.580]  INFO setWebTelemetryPath webTelemetryPath=/metrics
   [2020-09-24 12:22:02.581]  INFO setRocketmqVersion rocketmqVersion=420
   [2020-09-24 12:22:02.581]  INFO setNameSrvAddrByProperty 
nameSrvAddr=1.1.1.1:9876
   [2020-09-24 12:22:02.797]  INFO MetricsCollectTask init starting....
   [2020-09-24 12:22:02.915]  INFO cluster name= DefaultCluster, broker name = 
[broker-a]
   broker name = broker-a, master broker address= 1.1.1.1:10911
   `
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to