Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
Why you need to set up master->slaves ? –  mezgani Jan 30 '12 at 10:23
    
@mezgani I need it for replication process, Any thing which are written on master server is replicated automatically on slaves servers. –  Linuxstartway Jan 30 '12 at 14:16
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.