Hint
You're not able to control which redis replica will chosen for the failover.
-
Connect to your sentinel instance:
redis-cli -p <SENTINEL-PORT>
-
Have a look at the configured masters, current master and the available replicas
INFO sentinel
SENTINEL master <master name> SENTINEL get-master-addr-by-name <master name> # IP and port only
SENTINEL slaves <master name>
-
Force a failover
SENTINEL failover <master name>
-
After some seconds you can have a second look at the current master:
SENTINEL get-master-addr-by-name <master name>
The IP should have changed.
Related cards:
manual haproxy backend failover
If you want to perform a failover on another haproxy backend server this is the way you should do it:
Gather information
Via hatop
Note: Please mind that the names of frontends / backends / servers are only examples. Mind this when yo...
Run multiple Redis servers on Ubuntu
This is a way to run multiple redis server on one ubuntu server.
These steps you have to do only once:
- Adjust init script
Change some Variables.
From this:
DAEMON_ARGS=/etc/redis/redis.conf
NAM...
Delete specific Redis-DBs
To delete a specific redis-DB you need to use the FLUSHDB
-command in combination with the SELECT
-command. For more information have a look at the documentation for FLUSHDB and [SELECT](https://redis.io/com...
Migrate Redis data with RIOT
Ever needed to migrate data between Redis instances? Give RIOT - Redis Input/Output Tools a try. It supports migration to different versions and supports AWS ElastiCache.
Replication mode
Replicates all data fr...
Create swap space on Linux
Create a 1 GB file to swap to (we have sufficient space on / on this machine. Use a different partition if necessary)
sudo dd if=/dev/zero of=/var/swapfile bs=1M count=1024
If you prefer 2GB swap, chose count=2048
, 4GB: count=4096
C...
Fix "A client error (MalformedCertificate) occurred: Invalid Private Key." at AWS SSL Certificate upload
I'm creating certificate requests with this command:
openssl req -new -out www.example.com.csr -keyout www.example.com.key -newkey rsa:2048 -nodes
When I try to upload the certificate to AWS IAM I get this error:
$ aws iam upload-se...
Change / Update SSL certificate for Amazon Elastic Load Balancer with AWS Command Line Interface
-
Install and configure the AWS Command Line Interface
-
Show existing certificates to test if the AWS Cli is working:
$ aws iam list-server-certificates { "ServerCertificateMetadataList": [...
Bash: Find out the exit codes of all piped commands
Bash stores the exitcodestatus of piped commands in the environment variable PIPESTATUS
So you can just echo ${PIPESTATUS[@]}
to get them all.
13:52:30 ✔ claus:~$ ps ax | grep /usr/bin/ruby
13205 pts/20 S+ 0:00 grep --color=auto /...
puppet variable variable name
example
We want to make the following firewall rule to be applyable to different network interfaces (for e.g. different environments) with just one variable:
firewall { "010-reject-port":
ensure => present,
dport => [ 80...
Linux performance analysis
Brendan Gregg is the Linux performance god. Use the information in this link to find out what ways there are for performacne analysis.
This link is shows the more sophisticated way and encourages to dig deeper for optimizing your system. If you'r...