Showing posts from February, 2015

Deploying a HA Redis setup

Sentinel process takes the responsibility of electing a slave as master if a failure occurs. For more information refer  this. Install Redis in each node. Following methods can be used to install Redis.Using Ubuntu repositories. sudo apt-get install redis-serverManual installationYou can download a Redis distribution from this page Follow the instructions on this page to setup Redis using the downloaded setup requirepass property to set the password in the configuration file in /etc/redis. Note that this should be same in all nodes.Set Up replicationSet the following properties to set replication on slaves.slaveof <masterip> <masterport>masterauth <master-password> //The same password we used previouslySet masterauth property also in the master in case of master goes down and later joins as a slave (Once a slave is elected as a master). To test whether the …

Bind a remote server's port to a local port

If you have a remote server (say in Amazon EC2) you might want to access a particular port of that server. But there can be situations where it is not that port is not globally open. If you do not want to bother making it globally open you can use it by binding it to a local port of your workstation via ssh. Following command will bind port 9000 of remote machine to your local port 8000.  As an example if it is web server you can easily access it by typing localhost:8000 in your web browser. ssh -L 8000:localhost:9000 username@host