JStorm Worker程序启动连不上Oracle

时间:2021-01-31 07:47:00
  最近遇到jstorm的worker程序在启动时报包不到oracle的.so包的错误。
  初步是环境变量LD_LIBRARY_PATH的设置问题导致的,经过比较后发现本机上的LD_LIBRARY_PATH上设置了的,但是依然报错提示找不到.so的包。
  于是考虑jstorm的work进程是通过supervise拉起来的,通过查看supervise的日志发现,用的是nimbus主机的上环境变量$LD_LIBRARY_PATH,而本机的.so包所在目录与nimbus又不一样,所以找不到相应的.so包。
 
supervise日志如下:
[INFO 2018-06-13 19:58:59 c.a.j.d.s.SyncProcessEvent:842 EventManagerImp] Environment:{Lupervisor.log_LIBRARY_PATH=/usr/local/lib:/usr/lib:/opthb/release/JStorm/lib/dcclib:/oracle/app/oracle/product/db11gr2/lib:/timesten/TimesTen/tt112280/lib, REDIRECT=true}
[INFO 2018-06-13 19:58:59 c.a.j.d.s.SyncProcessEvent:842 EventManagerImp] Environment:{LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/opthb/release/JStorm/lib/dcclib:/oracle/app/oracle/product/db11gr2/lib:/timesten/TimesTen/tt112280/lib, REDIRECT=true}

worker程序报错日志:

[ERROR  2018-06-13 19:53:28.286 RefreshConnections:116 main-EventThread] Failed to get Assignment of notice-20-1528890681
[ERROR  2018-06-13 20:01:30.105 BoltExecutors:199 calc:1464-BoltExecutors] bolt execute error 
java.lang.UnsatisfiedLinkError: /opthb/release/JStorm/lib/dcclib/libDCCCeil.so: libclntsh.so.11.1: 无法打开共享对象文件: 没有那个文件或目录
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1854)
        at java.lang.Runtime.loadLibrary0(Runtime.java:870)
        at java.lang.System.loadLibrary(System.java:1122)
        at com.tydic.notice.work.calc.DCCCeil.<clinit>(DCCCeil.java:7)
        at com.tydic.notice.work.calc.CeilManager.GetValueFromDcc(CeilManager.java:269)
        at com.tydic.notice.work.calc.CeilManager.getOjbValue(CeilManager.java:173)
        at com.tydic.notice.work.calc.CeilManager.getValue(CeilManager.java:83)
        at com.tydic.notice.work.calc.StrategyCalc.PrepareCeil(StrategyCalc.java:119)
        at com.tydic.notice.work.calc.StrategyCalc.Judge(StrategyCalc.java:49)
        at com.tydic.notice.work.calc.CalcWork.planCalc(CalcWork.java:276)
        at com.tydic.notice.work.calc.CalcWork.calc(CalcWork.java:83)
        at com.tydic.notice.bolts.calc.CalcBolt.execute(CalcBolt.java:197)
        at backtype.storm.topology.BasicBoltExecutor.execute(BasicBoltExecutor.java:49)
        at com.alibaba.jstorm.task.execute.BoltExecutors.processTupleEvent(BoltExecutors.java:195)
        at com.alibaba.jstorm.task.execute.BoltExecutors.onEvent(BoltExecutors.java:173)
        at backtype.storm.utils.DisruptorQueueImpl.consumeBatchToCursor(DisruptorQueueImpl.java:191)
        at backtype.storm.utils.DisruptorQueueImpl.consumeBatchWhenAvailable(DisruptorQueueImpl.java:159)
        at com.alibaba.jstorm.task.execute.BoltExecutors.run(BoltExecutors.java:149)
        at com.alibaba.jstorm.callback.AsyncLoopRunnable.run(AsyncLoopRunnable.java:95)
        at java.lang.Thread.run(Thread.java:745)

结论:storm集群所有主机的安装环境,目录这些必须要一样才能保障不报错。