Install and configure memcacheq on CentOS 6.2

Recently, I needed to install memcached and memcacheq on CentOs 6.2 and unfortunately it was discovered that there were no ready-made ones in the repository, and I had to compile it myself. Moreover, for the assembly of the second - there is no normal and current instruction in either Russian or English. The latter, which is on all sites, is quite ancient and not entirely relevant. Google search finds only some wretched Chinese sites. So I want to fill this gap in the Russian segment of the network.

MemcacheQ Dependencies

  1. Libevent> 2.0.19 (current 2.0.19)
  2. Berkeley DB> 4.7 (current 5.3.21)


The libevent version in the libevent-1.4.13-1 Berkeley DB repository is not in the repository. All further actions are performed under the root account.
[root@oracle134 ~]# rpm -qa libevent






We put Libevent

Go to any folder convenient for you - for example / tmp

  1. [root@oracle134 tmp]#wget cloud.github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz
  2. [root@oracle134 tmp]#tar xvzf libevent-2.0.19-stable.tar.gz
  3. [root@oracle134 tmp]#cd libevent-2.0.19-stable
  4. [root@oracle134 libevent-2.0.19-stable]#./configure
  5. [root@oracle134 libevent-2.0.19-stable]#make
  6. [root@oracle134 libevent-2.0.19-stable]#make install


Berkeley db


Berkeley DB must first be downloaded from Oracle.com and downloaded to the server manually, since Oracle requires mandatory registration and authentication on the site to download. Further…

  1. [root@oracle134 tmp]#tar xvzf db-5.3.21.tar.gz
  2. [root@oracle134 tmp]]#cd db-5.3.21/build_unix
  3. [root@oracle134 build_unix]#../dist/configure
  4. [root@oracle134 build_unix]#make
  5. [root@oracle134 build_unix]#make install


A few extra steps

You need to add the lines:

/ usr / local / lib
/ usr / local / berkeleydb / lib /
to the /etc/ld.conf.so file to load the necessary .so modules.

  1. echo '/usr/local/lib' >> /etc/ld.conf.so
  2. echo '/usr/local/berkeleydb/lib/' >> /etc/ld.conf.so


It remains to download them and create a link to the directory so that memcacheq is compiled, since the wrong path to the Berkeley DB files is registered in its config file.
  1. [root@oracle134 tmp]#ln -s /usr/local/berkeleydb/ /usr/local/BerkeleyDB.4.7
  2. [root@oracle134 tmp]#ldconf


We put MemcacheQ


  1. [root@oracle134 tmp]#wget memcacheq.googlecode.com/files/memcacheq-0.2.0.tar.gz
  2. [root@oracle134 tmp]#tar xvzf memcacheq-0.2.0.tar.gz
  3. [root@oracle134 tmp]#cd memcacheq-0.2.0
  4. [root@oracle134 memcacheq-0.2.0]#./configure –enable-threads
  5. [root@oracle134 memcacheq-0.2.0]#make
  6. [root@oracle134 memcacheq-0.2.0]#make install


After all of the above, the process should go without problems. To verify the installation, run and try to connect:
  1. [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
  2. [root@oracle134 memcacheq-0.2.0]#telnet localhost 22201


If you succeeded in establishing a telnet connection, then everything is configured correctly. You can run the stats / stats queue commands to see the current status of the queues. quit - to exit.

Briefly on the options with which memcacheq is running:
  • -d - run as a daemon
  • -H / tmp / memcacheq - file where the queue database is stored
  • -u nobody - run as nobody
  • -L 1024 - log buffer size
  • -B 1024 - element size
  • -R - automatic removal of unnecessary logs
  • -v - detailed log mode
  • -N - enable some unclear DB_TXN_NOSYNC option to increase performance
  • -r - maximize kernel file size (with data?)

Last little things

All that remains is to add the startup script to /etc/init.d/, which you can
immediately get to gkirok.blogspot.com , copy it to /etc/init.d/, give execute rights and add it to startup
  1. [root@oracle134 ~]#chmod +x /etc/init.d/memcacheq
  2. [root@oracle134 ~]#chkconfig memcacheq on


References

  1. libevent
  2. Berkeley db
  3. Memcacheq


PS.
I got an invite from the sandbox, I transfer the article to public. If you chose the wrong hubs, please do not kick much, but indicate the correct ones.

Also popular now: