0

I'm using memcached-1.4.5-1.el5 & memcache-2.2.6 as php extension and memcached-1.2.8-repcached-2.2.1 for replication.

The above packages are installed on 4 servers. How can I do the following?

Server1 : Memcache Master

Server2,3,4 : Memcache Slave

And can I run memcached-repcached and memcache on the same default port 11211?

Kenny Rasschaert
  • 9,045
  • 3
  • 42
  • 58
Linuxstartway
  • 37
  • 2
  • 8

1 Answers1

1

Have a look at this page. It explains how to setup master-master replication. The memcached-repcached add two more options to the official memcached options which are:

-x < ip_addr > hostname or IP address of the master replication server
-X < num > TCP port number of the master (default: 11212)

It should be easier to setup master-slave replication if you want.

For your question about running memcached and memcached-repcached on the same port. You don't need to run the original memcached daemon and modified memcached-repcached daemon at the same time. If you want to use the replication feature, you don't need to run the original memcached daemon.

As a general rule, it is not allowed to run more than one service (daemon) on any specific port number on the same host.

Khaled
  • 36,533
  • 8
  • 72
  • 99
  • **Master** Server IP : **10.10.10.1** ..I put the following config for memcache repcache config ( on **Slave** Servers ) in _/etc/sysconfig/repconfig_ `PORT="11211"` `USER="memcached"` `MAXCONN="1024"` `CACHESIZE="256"` `OPTIONS="-x 10.10.10.1"` Is it right .? and does i need to put the same config in **master** server with removing of OPTIONS directive .? – Linuxstartway Jan 28 '12 at 11:14