Opsagent UnsupportedOperationException with PersistentHashMap

不问归期 提交于 2019-12-12 05:53:54

问题


I'm running Cassandra along with opscenter agent, and got the following error in the log when Opscenter tries to get general and CF metrics.

INFO [jmx-metrics-1] 2015-08-02 21:55:20,555 New JMX connection (127.0.0.1:7199)
INFO [jmx-metrics-1] 2015-08-02 21:55:20,558 New JMX connection (127.0.0.1:7199)
ERROR [jmx-metrics-2] 2015-08-02 21:55:25,448 Error getting CF metrics
java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap
at clojure.lang.RT.nthFrom(RT.java:857)
at clojure.lang.RT.nth(RT.java:807)
at opsagent.rollup$process_metric_map.invoke(rollup.clj:252)
at opsagent.metrics.jmx$cf_metric_helper.invoke(jmx.clj:96)
at opsagent.metrics.jmx$start_pool$fn__15320.invoke(jmx.clj:159)
at clojure.lang.AFn.run(AFn.java:24)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
ERROR [jmx-metrics-4] 2015-08-02 21:56:26,238 Error getting general metrics
java.lang.UnsupportedOperationException: nth not supported on this type: PersistentHashMap
at clojure.lang.RT.nthFrom(RT.java:857)
at clojure.lang.RT.nth(RT.java:807)
at opsagent.rollup$process_metric_map.invoke(rollup.clj:252)
at opsagent.metrics.jmx$generic_metric_helper.invoke(jmx.clj:73)
at opsagent.metrics.jmx$start_pool$fn__15334$fn__15335.invoke(jmx.clj:171)
at opsagent.metrics.jmx$start_pool$fn__15334.invoke(jmx.clj:170)
at clojure.lang.AFn.run(AFn.java:24)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Any idea what the UnsupportedOperationException is about? I'm not familiar with Clojure, but I don't know why a) the error occurred and b) why nth isn't supported by PersistentArrayMap.

Please help, thanks.


回答1:


This is a bug (fixed but unreleased) in the agent that happens after the agent config was changed at runtime. You can try restarting the agent since the initial loading of the configuration is Ok.

It is possible that this can occur when opscenterd pushes cluster configs to agent. To work around this until the next release you can make any of those cluster config changes in the agents local address.yaml and remove it from the clustername.conf on opscenter server. I would recommend just trying to restart the agent first though since that may be a bit of effort with a lot nodes.



来源:https://stackoverflow.com/questions/31777084/opsagent-unsupportedoperationexception-with-persistenthashmap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!