📜 ⬆️ ⬇️

Installing and configuring memcacheq on CentOS 6.2

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

  1. Libevent> 2.0.19 (current 2.0.19)
  2. 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

  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 uploaded to the server manually, since Orakl requires mandatory registration and authentication on the site for downloading. 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


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.

  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, in order for memcacheq to compile, because 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 the above process should go without problems. To check 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 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:

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
  1. [root@oracle134 ~]#chmod +x /etc/init.d/memcacheq
  2. [root@oracle134 ~]#chkconfig memcacheq on


Links

  1. libevent
  2. Berkeley db
  3. 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.

Source: https://habr.com/ru/post/149824/


All Articles