安装前需安装的插件
1)yum insatll gcc
2)yum install popt
3)yum install openssl
4)yum install xmlto
5)yum install doxygen
6)yum install cmake
==============
安装rabbbitmq-c
wget https://codeload.github.com/alanxz/rabbitmq-c/tar.gz/v0.8.0
tar zxvf rabbitmq-c-0.8.0.tar.gz
cd rabbitmq-c-0.8.0
makedir build and cd build
cmake ..
cmake --build .
===================
yum install autoconf
yum install automake
yum install libtool
yum install pkg-config
======================
cd rabbitmq-c-0.8.0
autoreconf -i
./configure
make
make install
====================
测试是否能通信的方法:
./examples/amqp_listen localhost 5672 amq.direct test
./examples/amqp_sendstring localhost 5672 amq.direct test "hello world"
=================需开启rabbitmq服务
============
下载安装rabbitmq-server
1)安装erlang语言环境
wget http://erlang.org/download/otp_src_18.3.tar.gz
tar -zxvf otp_src_18.3.tar.gz
cd otp_src_18.3
./configure
make && make install
2)配置erlang
vi /etc/profile
source /etc/profile
3)测试erlang
erl
halt() 退出
==============================================================================================================================
下载安装并启动rabbitmq-server
1) wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-3.6.1-1.noarch.rpm
rpm -ivh --nodeps rabbitmq-server-3.6.1-1.noarch.rpm
cd /usr/lib/rabbitmq
ls
cd bin
ls
./rabbitmq-server
==========================================
然后进入rabbitmq-c的下载目录下找到examples
cd /root/tools/rabbitmq-c-0.8.0
在一个终端下输入命令:
./examples/amqp_listen localhost 5672 amq.direct test
在另一个终端下输入另一个命令:
./examples/amqp_sendstring localhost 5672 amq.direct test "hello world"
注:将amqp.lua amqp-util.lua 放到/usr/local/openresty-1.9.7.2/luajit/share/luajit-2.1.0-beta1路径下