install zeromq
wget http://download.zeromq.org/zeromq-4.0.5.tar.gz
tar -zxvf zeromq-4.0.5. tar.gz
cd zeromq-4.0.5
cd foreign/openpgm/
tar -zxvf libpgm-5.2.122~dfsg.tar.gz
./configure --prefix=/data/klj/zeromq --with-pgm =libpgm-5.2.122~dfsg
make
make install
Install php-zmq extension
git clone git://github.com/mkoppanen/php-zmq.git
cd php-zmq
/data/klj/ php/bin/phpize
./configure --with-php-c/klj/php/bin/php-config --with-zmq=/data/klj/zeromq
make && make install
Modify php.ini and restart
Error configure: error: Please reinstall the pkg-config distribution
wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
tar -zxvf pkg-config-0.28.tar.gz
cd pkg-config-0.28
./configure --with-internal-glib
make && make install
ZMQ (hereinafter ZeroMQ is referred to as ZMQ) is a simple and easy-to-use transport layer, a socket library like a framework. It makes Socket programming simpler, more concise and more performant. Is a message processing queue library that elastically scales across multiple threads, cores, and host boxes. The clear goal of ZMQ is to "become part of the standard network protocol stack and then enter the Linux kernel
Feature introduction:
ZMQ is not like a message queue server in the traditional sense. In fact, it is not a server at all, it is more like It is a low-level network communication library that encapsulates the Socket API to abstract network communication, process communication and thread communication into a unified API interface. Disadvantages: ZeroMq does not support message persistence and is prone to data loss.
Supports 3 modes:
single queue mode
2. Publish-subscribe
subscription mode
3. PipeLine model
If we need to count the logs of each machine, we need to distribute the statistical tasks to each node machine on, finally collect the statistical results and make a summary
Reference blog:
ZMQ API reference manual: http://api.zeromq.org /
PHP user manual can be referred to: http://zguide.zeromq.org/php:all
ZMQ PHP Programming reference manual: http://php.zero.mq (unreachable)
ZeroMQ, the fastest message queue in history—ZMQ learning and research http://news.cnblogs.com/n/154000/
Here it is A large number of program examples are available for reference: https://github.com/imatix/zguide