[转]Centos安装zeromq和jzmq

Required packages:

    autoconf
    automake
    libtool
    gcc
    gcc-g++
    make
    libuuid-dev
    git
    java-1.6.0-openjdk-devel

1) Download and unpack ZeroMQ 2.1.10.

$ wget http://download.zeromq.org/zeromq-2.1.10.tar.gz
$ tar zxf zeromq-2.1.10.tar.gz

2) Build

$ cd zeromq-2.1.10
$ ./configure --with-pgm
$ make
$ sudo make install

Now libzmq.so should reside in /usr/local/lib

3) Clone JZMQ from GitHub.

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

4) Build

$ cd jzmq
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

5) Setup environment

$ sudo bash

optional step #1 (not required on Debian platforms)

    # echo /usr/local/lib > /etc/ld.so.conf.d/local.conf
    # ldconfig

optional step #2

    # echo CLASSPATH=/usr/local/share/java/zmq.jar:. >> /etc/environment
    Incredibly limiting as you will still need to override to include any other directory or JAR file.

optional step #3

    # echo export LD_LIBRARY_PATH=/usr/local/lib > /etc/profile.d/ldlibrarypath.sh
    This is pretty much a workaround to a JRE defect:
    http://lists.fedoraproject.org/pipermail/java-devel/2011-March/004153.html
# exit

Then log out and log back in again.

6) Verify new environment

$ echo $CLASSPATH
/usr/local/share/java/zmq.jar:.
$ echo $LD_LIBRARY_PATH
/usr/local/lib

7) Test with Java ?MQ performance examples

$ cd jzmq/perf
$ java local_lat tcp://127.0.0.1:5000 1 100

This will fail if zmq.jar cannot be found in the class path.
This will fail if libjzmq.so or libzmq.so cannot be found in java.library.path or LD_LIBRARY_PATH.

If you skip optional step #1 you will need to specify the library path:

$ LD_LIBRARY_PATH=/usr/local/lib java local_lat tcp://127.0.0.1:5000 1 100

If you skip optional step #2 you will need to specify the class path:

$ java -cp /usr/local/share/java/zmq.jar:. local_lat tcp://127.0.0.1:5000 1 100

Note that setting -Djava.library.path is insufficient for libjzmq.so to find libzmq.so but it is sufficient if you take optional step #1 and skip optional step #3, i.e. LD_LIBRARY_PATH is not overridden but ld.so.conf is updated.

$ java -Djava.library.path=/usr/local/lib local_lat tcp://127.0.0.1:5000 1 100

http://chqz1987.blog.163.com/blog/static/51438311201351511493091/ 
时间: 2024-08-07 20:52:48

[转]Centos安装zeromq和jzmq的相关文章

centos安装zeromq, jzmq

先安装各种所需的依赖包 # yum install gcc # yum install gcc-c++  libtool jzmq 是zeromq 的java客户端 下载地址 https://github.com/zeromq/jzmq/downloads

Linux(CentOS)安装配置zeromq、jzmq(解决各种问题)

今天为Hadoop配置zeromq.jzmq遇到各种问题,先是编译出错,到编译成功后测试出错等等,下面将我遇到的问题与大家分享一下. 第一个注意点是:必须先编译安装zeromq,然后在编译jzmq,否则会报zmq.h文件找不到. 官方安装配置链接:http://zeromq.org/bindings:java Step 1:安装必须的依赖包: [[email protected] ~]$ sudo yum install autoconf automake libtool gcc gcc-g++

CentOS 安装redis 2.8.7

波折了好几下才装上 1.下载 wget http://download.redis.io/releases/redis-2.8.7.tar.gz 下载后的文件在当前目录里 redis-2.8.7.tar.gz 2.编译安装 tar xf redis-2.8.7.tar.gz cd redis-2.8.7 make make install 如果没有安装gcc的话会提示gcc not found 于是就需要安装一下gcc: yum -y install gcc 因为刚开始把yum的源换成163的了

centos安装gearman

centos安装gearman post by rocdk890 / 2012-8-4 1:11 Saturday linux技术 发表评论 今天公司让我在服务器上安装gearman,服务器环境是lamp,那gearman是什么?其实这个gearman是一个处理分布式过程通信的健壮系统.它提供了一个通用的应用程序框架,主要用来把任务转发给到其他机器或进程.使用Gearman 能让程序实现并行工作.负载均衡和跨语言调用.它能够用于不同类型的应用程序,从高可用的web站点到数据库复制传输. 系统:c

Centos 安装 禅道

Centos 安装  禅道 一.环境准备: 1.服务器:Centos6.7 新系统 2.查看对应的系统版本:uname -a和cat /etc/redhat CentOS release 6.7 (Final) 二.安装: 1.下载对应系统版本的zbox禅道一键安装包,解压至/opt目录下 从window  电脑 到下面的地址下载最新的禅道版本 https://sourceforge.net/projects/zentao/files/9.0.1/ZenTaoPMS.9.0.1.zbox_64.

centos安装net-speeder

以前介绍过VPS上安装锐速对VPS的加速效果,但是这货对 Linux 内核有要求,一般就只能在XEN或者KVM的机子上安装.不过还好锐速有一个免费的代替品:net-speeder,所以这里介绍一下 Debian/Ubuntu 上安装 net-speeder 并对 net-speeder 的夸张带宽占用做一些优化. 软件 Github 地址:net-speeder 安装过程: CentOS安装 wget --no-check-certificate https://gist.github.com/

CentOS安装桌面环境

相信很多人在学习linux的时候,看的教程(书,或视频),很多都是说,在安装系统的时候, 选择最小化安装,装好系统之后,需要什么软件就装什么软件.不去好好找找,是不会知道系统 默认会安装多少软件,软件安装的位置...当然,作为图形界面的桌面环境,服务器上是绝对 不会安装的,因为图像处理是最消耗计算机性能的软件,windows慢,也是因为这个原因了(这 句是发闹骚) 当然,在一个伟大的linux系统工程师,刚接触linux的时候,把linux作为自己日常使用的计算机( 特别是从winddow转过来

centos 安装memcache服务后memcahce本机连接Permission

自己手动在虚拟机下装了下memcache,整个过程真是充满波折,本身用php5.3安装memcache扩展就麻烦很多,无法通过yum直接安装,安装方法详见http://chenwei.me/blog/server/69.html,接下来安装memcache服务,安装成功后,telnet可以成功,不过好像不是立即成功生效,过一会用stats才会有详细显示. 本机用 <?php $mem = new Memcache; $mem->connect(‘192.168.124.129′,11211)

CentOS 安装软件时,错误Transaction check error ... file...conflicts with file from package zzz的解决

CentOS 安装软件时(比如:# yum install subversion),有时候会碰到类似如下的错误: Transaction check error: file /usr/lib64/libsvn_client-1.so.0.0.0 from install of subversion-1.8.11-1.x86_64 conflicts with file from package subversion-libs-1.7.14-7.el7_0.x86_64 file /usr/lib