It was necessary to install memcached and memcacheq on CentOs 6.2 recently and unfortunately it was discovered that there are no ready-made ones in the repository, and it is necessary to compile it yourself. Moreover, there is no normal or up-to-date instruction on the assembly of the second one either in Russian or in English. The latter which is on all sites is quite ancient and not quite relevant. Google search finds only some poor Chinese sites. So I want to fill this gap in the Russian segment of the network.
MemcacheQ dependencies
- Libevent> 2.0.19 (current 2.0.19)
- Berkeley DB> 4.7 (current 5.3.21)
Version of libevent in the repository
[root@oracle134 ~]# rpm -qa libevent
libevent-1.4.13-1
Berkeley DB is not in the repository.
All further actions are performed under an account with root rights.
')
We put Libevent
Go to any convenient folder for you - for example / tmp
[root@oracle134 tmp]#wget cloud.github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz
[root@oracle134 tmp]#tar xvzf libevent-2.0.19-stable.tar.gz
[root@oracle134 tmp]#cd libevent-2.0.19-stable
[root@oracle134 libevent-2.0.19-stable]#./configure
[root@oracle134 libevent-2.0.19-stable]#make
[root@oracle134 libevent-2.0.19-stable]#make install
Berkeley db
Berkeley DB must first be downloaded from Oracle.com and uploaded to the server manually, since Orakl requires mandatory registration and authentication on the site for downloading. Further…
[root@oracle134 tmp]#tar xvzf db-5.3.21.tar.gz
[root@oracle134 tmp]]#cd db-5.3.21/build_unix
[root@oracle134 build_unix]#../dist/configure
[root@oracle134 build_unix]#make
[root@oracle134 build_unix]#make install
Several additional steps
It is necessary to add lines:
/ usr / local / lib
/ usr / local / berkeleydb / lib /
in the /etc/ld.conf.so file to load the necessary .so modules.
echo '/usr/local/lib' >> /etc/ld.conf.so
echo '/usr/local/berkeleydb/lib/' >> /etc/ld.conf.so
It remains to download them and create a link to the directory, in order for memcacheq to compile, because the wrong path to the Berkeley DB files is registered in its config file.
[root@oracle134 tmp]#ln -s /usr/local/berkeleydb/ /usr/local/BerkeleyDB.4.7
[root@oracle134 tmp]#ldconf
We put MemcacheQ
[root@oracle134 tmp]#wget memcacheq.googlecode.com/files/memcacheq-0.2.0.tar.gz
[root@oracle134 tmp]#tar xvzf memcacheq-0.2.0.tar.gz
[root@oracle134 tmp]#cd memcacheq-0.2.0
[root@oracle134 memcacheq-0.2.0]#./configure –enable-threads
[root@oracle134 memcacheq-0.2.0]#make
[root@oracle134 memcacheq-0.2.0]#make install
After all the above process should go without problems. To check the installation, run and try to connect:
[root@oracle134 memcacheq-0.2.0]#memcacheq -d -r -H /tmp/memcacheq -N -R -v -L 1024 -B 1024 > /tmp/mq_error.log -u nobody 2>&1
[root@oracle134 memcacheq-0.2.0]#telnet localhost 22201
If you can connect to telnet, then everything is set up correctly. You can run the stats / stats queue commands to view the current status of the queues. quit - to exit
Briefly on the options with which memcacheq is running:
- -d - start as a demon
- -H / tmp / memcacheq - the file where the queue database is stored
- -u nobody - run as user nobody
- -L 1024 - log buffer size
- -B 1024 - element size
- -R - automatic removal of unnecessary logs
- -v -detail logs
- -N - enable some incomprehensible DB_TXN_NOSYNC option to increase performance
- -r-makes the maximum size of the kernel file (with data?)
Last little things
It remains only to add a startup script in /etc/init.d/, which can be directly taken via the link
gkirok.blogspot.com , copy to /etc/init.d/, give permissions to execute and add to autoload
[root@oracle134 ~]#chmod +x /etc/init.d/memcacheq
[root@oracle134 ~]#chkconfig memcacheq on
Links
- libevent
- Berkeley db
- MemcacheQ
Ps.
Got an invite from the sandbox, transfer the article to the public. If you choose the wrong hubs, please do not kick much, but indicate the correct ones.