我在一个交易引擎上工作,在运行时,我从engine.log
以下内容中获取日志,
2018_01_02_03_28_20_684 INFO ZMQCommunicatorService REMOTE_EXECUTOR_MARKET_ADMIN-ALL_MARKETS-0-5 - no jzmq in java.library.path, sleeping 2 minutes then try again
2018_01_02_03_28_20_697 INFO ZMQCommunicatorService ENGINE_MARKET_ADMIN-ALL_MARKETS-0-4 - Could not initialize class org.zeromq.ZMQ, sleeping 2 minutes then try again
2018_01_02_03_30_20_696 INFO ZMQCommunicatorService REMOTE_EXECUTOR_MARKET_ADMIN-ALL_MARKETS-0-5 - Could not initialize class org.zeromq.ZMQ, sleeping 2 minutes then try again
2018_01_02_03_30_20_710 INFO ZMQCommunicatorService ENGINE_MARKET_ADMIN-ALL_MARKETS-0-4 - Could not initialize class org.zeromq.ZMQ, sleeping 2 minutes then try again
2018_01_02_03_32_20_697 INFO ZMQCommunicatorService REMOTE_EXECUTOR_MARKET_ADMIN-ALL_MARKETS-0-5 - Could not initialize class org.zeromq.ZMQ, sleeping 2 minutes then try again
2018_01_02_03_32_20_711 INFO ZMQCommunicatorService ENGINE_MARKET_ADMIN-ALL_MARKETS-0-4 - Could not initialize class org.zeromq.ZMQ, sleeping 2 minutes then try again
2018_01_02_03_34_20_698 INFO ZMQCommunicatorService REMOTE_EXECUTOR_MARKET_ADMIN-ALL_MARKETS-0-5 - Could not initialize class org.zeromq.ZMQ, sleeping 2 minutes then try again
2018_01_02_03_34_20_712 INFO ZMQCommunicatorService ENGINE_MARKET_ADMIN-ALL_MARKETS-0-4 - Could not initialize class org.zeromq.ZMQ, sleeping 2 minutes then try again
2018_01_02_03_36_20_699 INFO ZMQCommunicatorService REMOTE_EXECUTOR_MARKET_ADMIN-ALL_MARKETS-0-5 - Could not initialize class org.zeromq.ZMQ, sleeping 2 minutes then try again
2018_01_02_03_36_20_713 INFO ZMQCommunicatorService ENGINE_MARKET_ADMIN-ALL_MARKETS-0-4 - Could not initialize class org.zeromq.ZMQ, sleeping 2 minutes then try again
我相信第一行说明了主要问题,
No jzmq in java.library.path
ZMQ binding
我遵循了for Java的设置手册,
cd /root
wget https://github.com/zeromq/jzmq/archive/v3.1.0.tar.gz -O jzmq-3.1.0.tar.gz
tar zxf jzmq-3.1.0.tar.gz
cd jzmq-3.1.0
./autogen.sh
./configure --prefix=/opt/jzmq-3.1.0
nice make
make install
加载项目后,需要在项目根目录中运行命令,
root@debian:~# export LD_LIBRARY_PATH=/opt/jzmq-3.1.0/lib
root@debian:~# java -Xss256k -cp /opt/jzmq-3.1.0/share/java/zmq.jar:draglet-common/target/lib/*:draglet-balser/target/lib/*:draglet-engine/target/lib/*:draglet-remote/target/lib/*:draglet-mapu/target/lib/*:draglet-shaba/target/lib/*:draglet-meba/target/lib/* -Dlog4j.configurationFile=draglet-common/src/main/resources/log4j2.xml -DisThreadContextMapInheritable=true com.draglet.batch.Batch draglet.yml
当时我得到像这样的输出,
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
Tue Jan 02 03:59:17 EST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Intellij
该问题与终端中提供的警告有关吗?如何检查 jzmq 是否在java.library.path
?