Linux (CentOS) installation configuration zeromq, JZMQ (solve various problems)

Source: Internet
Author: User

Today for Hadoop configuration Zeromq, JZMQ encountered a variety of problems, first compile error, to compile a successful test error, and so on, the following I encountered the problem to share with you.

The first note is: You must compile and install ZEROMQ, and then compile JZMQ, otherwise you will be reported zmq.h file cannot be found.

Official installation Configuration link: Http://zeromq.org/bindings:java

Step 1: Install the necessary dependent packages:

sudo Yum Install GCC GCC  make Libuuid-dev git java-1.6. 0-openjdk-devel

Note: Some of these packages are different depending on the operating system, so it is not the name above, please use the Yum list avaiable *package name* to query the available packages and install them. For example: Look for OpenJDK, the blue background is what we are looking for.

[Email protected] jzmq]#sudo YumList avaiable *openjdk*Loaded plugins:fastestmirror, langpacks ...Available Packagesjava-1.6.0-openjdk.x86_641:1.6.0.33-1.13.5.0. El7_0 Updatesjava-1.6.0-openjdk-demo.x86_641:1.6.0.33-1.13.5.0. El7_0 updatesjava -1.6. 0-openjdk-devel.x86_64 1:1.6. 0.33-1.13. 5.0  . El7_0 updatesJava-1.6.0-openjdk-javadoc.x86_641:1.6.0.33-1.13.5.0. El7_0 Updatesjava-1.6.0-openjdk-src.x86_641:1.6.0.33-1.13.5.0. El7_0 Updatesjava-1.7.0-openjdk.x86_641:1.7.0.71-2.5.3.1. El7_0 Updatesjava-1.7.0-openjdk-accessibility.x86_641:1.7.0.71-2.5.3.1. El7_0 Updatesjava-1.7.0-openjdk-demo.x86_641:1.7.0.71-2.5.3.1. El7_0 Updatesjava-1.7.0-openjdk-devel.x86_641:1.7.0.71-2.5.3.1. El7_0 Updatesjava-1.7.0-openjdk-headless.x86_641:1.7.0.71-2.5.3.1. El7_0 Updatesjava-1.7.0-openjdk-javadoc.noarch1:1.7.0.71-2.5.3.1. El7_0 Updatesjava-1.7.0-openjdk-src.x86_641:1.7.0.71-2.5.3.1. El7_0 updates[[email protected] jzmq]# sudo yum install java-1.6. 0-openjdk- devel.x86_64 #安装Loaded plugins:fastestmirror, langpacksloading mirror speeds from cached Hostfil E                 ............ Dependency Updated:python-javapackages.noarch0:3.4.1-6. El7_0 Complete![email protected] jzmq]#

Step 2: Compile and install zeromq-2.1.7

2.1 Unpacking the Package

tar -zxvf zeromq-2.1. 7. tar. gz

2.2 Build&&install

./autogen.sh. /Configuremakesudomakeinstall

Step 3: Compile and install JZMQ

3.1 Clone JZMQ from GitHub

$ git clone https://github.com/zeromq/jzmq.git

3.2 Bulid&&install (official offer steps, unfortunately not)

$ cd jzmq$. /autogen. SH $ . /make#在执行make的时候报 make[1]: *** No rule to make target `classdist_noinst.stamp‘, needed by `org/zeromq/ZMQ.class‘. Stop.   sudo make install 

3.3 Error Exclusions

1) Ensure that the Step 1 dependency pack is fully installed

2) Check that the JDK is not used openjdk6, if not please java_home temporarily point to/usr/lib/jvm/java-1.6.0-openjdk.x86_64/

Echo $JAVA _home/usr/java/jdk1. 6 . 0_45  ~]$ java_home=/usr/lib/jvm/java-1.6. 0-openjdk.x86_64/

3.4 Resolving errors

1) Switch the directory to JZMQ/SRC

2)touch classdist_noinst.stamp

3) Execution:

classpath=.:./.: $CLASSPATH javac-d. Org/zeromq/zmq.java Org/zeromq/zmqexception.java Org/zeromq/zmqqueue.java Org/zeromq/zmqforwarder.java org/zeromq/ Zmqstreamer.java

4)

CD ... /autogen. SH . /Configuremakesudomakeinstall

5) test whether the installation is successful, switch to the jzmq/perf/directory, execute sh local_lat.sh tcp://127.0.0.1:5000 1 to test:

[Email protected] jzmq]$ CD perf/[email protected] perf]$SHLocal_lat.SHTcp://127.0.0.1:5000 1ExceptioninchThread"Main"Java.lang.UnsatisfiedLinkError:no jzmq   in Java.library.path at Java.lang.ClassLoader.loadLibrary (Classloader.java:1738) at Java.lang.Runtime.loadLibrary0 (Runtime.java:823) at Java.lang.System.loadLibrary (System.java:1028) at Org.zeromq.ZMQ.<clinit> (Zmq.java: the) at Local_lat.main (Local_lat.java: $)

No jzmq in Java.library.path???

Workaround:

Export java_library_path=/usr/local/lib or export Ld_library_path=/usr/local/Lib It is best to join it ~/   VI ~/. BASHRC Export Ld_library_path=/usr/local/lib

Then in the test everything OK, first executed under a terminal:sh local_lat.sh tcp://127.0.0.1:5000 1

[[email protected] perf]$ source ~/sh local_lat.sh tcp://127.0.0.1:5000 1 100 

At this point, open another terminal execution:sh remote_lat.sh tcp://127.0.0.1:5000 1

[[Email protected] jzmq]$ CD perf/pwd/home/mdrill01/component/jzmq/sh remote_ Lat.sh tcp://127.0.0.1:5000 11  [B] # # # # #说明测试成功 10 0140.0

Reference: Compiling JZMQ on Ubuntu

Hadoop and Jzmq-no jzmq in Java.library.path

Linux (CentOS) installation configuration zeromq, JZMQ (solve various problems)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.