twosigma / riemann-jmx

A reliable JMX connector for Riemann
Eclipse Public License 1.0
25 stars 22 forks source link

is it possible to disable netty epoll and rebuild with lein #4

Open rojomisin opened 9 years ago

rojomisin commented 9 years ago

our centos image has restrictive policies for /tmp, and I cannot seem to force the java process to use an alternate tmp dir. It could also be umask related, but first I would like to to build riemann-jmx-clj without netty epoll. the error i'm getting while trying to start the service is

ERROR [2015-05-29 18:27:38,871] main - riemann.bin - Couldn't start
java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: /tmp/libnetty-transport-native-epoll4869207597932075362.so: /tmp/libnetty-transport-native-epoll4869207597932075362.so: failed t
o map segment from shared object: Operation not permitted
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:188)
        at clojure.core$deref_future.invoke(core.clj:2180)
        at clojure.core$future_call$reify__6320.deref(core.clj:6420)
        at clojure.core$deref.invoke(core.clj:2200)
        at clojure.core$pmap$step__6333$fn__6335.invoke(core.clj:6470)
        at clojure.lang.LazySeq.sval(LazySeq.java:40)
        at clojure.lang.LazySeq.seq(LazySeq.java:49)
        at clojure.lang.Cons.next(Cons.java:39)
        at clojure.lang.RT.next(RT.java:598)
        at clojure.core$next.invoke(core.clj:64)
        at clojure.core$dorun.invoke(core.clj:2856)
        at riemann.core$transition_BANG_.invoke(core.clj:156)
        at clojure.lang.Atom.swap(Atom.java:51)
        at clojure.core$swap_BANG_.invoke(core.clj:2233)
        at riemann.config$apply_BANG_.invoke(config.clj:295)
        at riemann.bin$_main.invoke(bin.clj:69)
        at riemann.bin$_main.invoke(bin.clj:58)
        at clojure.lang.AFn.applyToHelper(AFn.java:154)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at riemann.bin.main(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: /tmp/libnetty-transport-native-epoll4869207597932075362.so: /tmp/libnetty-transport-native-epoll4869207597932075362.so: failed to map segment from shared obje
ct: Operation not permitted
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1851)
        at java.lang.Runtime.load0(Runtime.java:795)
        at java.lang.System.load(System.java:1062)
        at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:193)
        at io.netty.channel.epoll.Native.<clinit>(Native.java:46)
        at io.netty.channel.epoll.EpollEventLoop.<init>(EpollEventLoop.java:70)
        at io.netty.channel.epoll.EpollEventLoopGroup.newChild(EpollEventLoopGroup.java:71)
        at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:64)
        at io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:49)
        at io.netty.channel.epoll.EpollEventLoopGroup.<init>(EpollEventLoopGroup.java:56)
        at io.netty.channel.epoll.EpollEventLoopGroup.<init>(EpollEventLoopGroup.java:48)
        at io.netty.channel.epoll.EpollEventLoopGroup.<init>(EpollEventLoopGroup.java:41)
        at io.netty.channel.epoll.EpollEventLoopGroup.<init>(EpollEventLoopGroup.java:34)
        at riemann.transport.tcp$fn__5914.invoke(tcp.clj:79)
        at riemann.transport.tcp.TCPServer.start_BANG_(tcp.clj:133)
        at riemann.service$fn__3148$G__3142__3150.invoke(service.clj:20)
        at riemann.service$fn__3148$G__3141__3153.invoke(service.clj:20)
        at clojure.core$pmap$fn__6328$fn__6329.invoke(core.clj:6466)
        at clojure.core$binding_conveyor_fn$fn__4145.invoke(core.clj:1910)
        at clojure.lang.AFn.call(AFn.java:18)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
INFO [2015-05-29 18:27:38,928] clojure-agent-send-off-pool-4 - riemann.transport.udp - UDP server 127.0.0.1 5555 16384 -1 online

i have forked the riemann repo and commented out the epoll lines in https://github.com/rojomisin/riemann/blob/epolldisabled/src/riemann/transport/tcp.clj

Can I now build this by pointing the project.clj url at this branch? https://github.com/twosigma/riemann-jmx/blob/master/project.clj#L3

thanks for any help!

asterr commented 8 years ago

I was able to get this working on Centos 6.7 (where /tmp is mounted with noexec by default).

The trick was to invoke java with -Djava.io.tmpdir=/var/tmp

I did this for riemann by adding the following to /etc/sysconfig/riemann:

EXTRA_JAVA_OPTS=-Djava.io.tmpdir=/var/tmp