Skip to content

webo3/memcached-init

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Automatic memcached replication on service restart.

Make sure you are aware that memcached-tool dump command can lock your memcached instance for a while if it has a lot of records, this warning is displayed when running the memcached-tool.

Copy memcache-copy.sh and memcache-firewall.sh in /usr/local/sbin/

chmod +x *.sh
cp *.sh /usr/local/sbin

Modify the systemctl start-up configuration

Run the following command to start an editor

systemctl edit memcached

Put the following, save and exit.

[Service]
ExecStartPre=+/usr/local/sbin/memcache-firewall.sh
ExecStartPost=+/usr/local/sbin/memcache-copy.sh
ExecStopPost=+/usr/local/sbin/memcache-firewall.sh
EnvironmentFile=/etc/default/memcached

Edit /etc/default/memcached and add your remote host.

nano /etc/default/memcached

Put your remote host in it.

REMOTE_CACHE="your-remote-memcached-server:11211"

Restart memcached to test the setup.

systemctl restart memcached

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages