Linux redis-Sentinel configuration details

Linux redis-Sentinel configuration details

download

Download address: https://redis.io/download

Execute the download in the /usr/local/src directory.

wget http://download.redis.io/releases/redis-3.2.8.tar.gz

Install

Unzip it to the /usr/local/src directory and put the source package.

tar xzf redis-3.2.8.tar.gz

Create the directory /usr/local/redis:

make dir /usr/local/redis

Enter the source directory:

cd /usr/local/src/redis-3.2.8

Then execute the following make command to compile and install it to the directory /usr/local/redis/ (where the executable file is placed).

make PREFIX=/usr/local/redis install

Soft connection

The program is soft-linked to the bin directory for direct execution.

ln -s /usr/local/redis/bin/redis-cli /usr/local/bin/redis-cli
ln -s /usr/local/redis/bin/redis-sentinel /usr/local/bin/redis-sentinel
ln -s /usr/local/redis/bin/redis-server /usr/local/bin/redis-server

Configuration Files

Copy the configuration files. There are sentinel.conf and redis.conf files in the source code package. Copy them to the /etc/redis/ directory. If there are multiple instances, it is recommended to rename them. For example, the redis port used in this instance is 7021, and the sentinel port is 17021:

mkdir /etc/redis
cp /usr/local/src/redis-3.2.8/redis.conf /etc/redis/redis_6379.conf 
cp /usr/local/src/redis-3.2.8/sentinel.conf /etc/redis/sentinel_26379.conf

redis_master_6379.conf configuration

Modify the following configuration parameters:

port 6379
daemonize yes
#requirepass 123456
#masterauth 123456

The daemonize attribute is changed to yes (background run).

redis_slave_6380.conf configuration :

Modify the following configuration parameters:

port 6380
daemonize yes
#requirepass yingjun
slaveof 192.168.248.128 6379
masterauth 123456

The configuration of other slaves is the same as this one.

sentinel_26379.conf configuration

port 23791
daemonize yes
logfile "/var/log/sentinel_63791.log"
#master-1
sentinel monitor master-1 192.168.248.128 6379 2
#sentinel auth-pass master-1 yingjun

sentinel_26380.conf configuration

port 23780
daemonize yes
logfile "/var/log/sentinel_63780.log"
#master-1
sentinel monitor master-1 192.168.248.128 6379 2
#sentinel auth-pass master-1 yingjun

start up

Start the services in sequence.

redis-server /etc/redis/redis_master_6379.conf
redis-server /etc/redis/redis_slave_6380.conf 
redis-sentinel /etc/redis/sentinel_26379.conf
redis-sentinel /etc/redis/sentinel_26380.conf

Check whether all processes have been started

[root@iZj6cqZ redis]# ps -ef | grep redis
root 10910 1 0 08:11 ? 00:00:00 redis-server 127.0.0.1:6379
root 10918 1 0 08:11 ? 00:00:00 redis-server 127.0.0.1:6380
root 10939 1 0 08:15 ? 00:00:00 redis-sentinel *:26379 [sentinel]
root 10944 1 0 08:15 ? 00:00:00 redis-sentinel *:26380 [sentinel]
root 10948 10851 0 08:15 pts/1 00:00:00 grep --color=auto redis

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Redis Sentinel monitoring configuration steps for high availability cluster implementation
  • Example of building a redis-sentinel cluster based on docker
  • Play with Redis and build a cluster: Sentinel detailed explanation
  • Detailed explanation of SpringBoot Redis adaptive configuration (Cluster Standalone Sentinel)
  • Detailed steps for implementing high availability configuration of Redis Sentinel
  • Redis Sentinel service configuration process (detailed explanation)
  • Detailed explanation of redis high availability cluster configuration supported by sentinel

<<:  11 ways to remove duplicates from js arrays

>>:  Analyze Mysql transactions and data consistency processing issues

Recommend

JavaScript anti-shake case study

principle The principle of anti-shake is: you can...

Summary of 11 amazing JavaScript code refactoring best practices

Table of contents 1. Extracting functions 2. Merg...

Docker image creation Dockerfile and commit operations

Build the image There are two main ways to build ...

MySQL Basic Tutorial: Detailed Explanation of DML Statements

Table of contents DML statements 1. Insert record...

Analyze the compilation and burning of Linux kernel and device tree

Table of contents 1. Prepare materials 2. Downloa...

Web developers are concerned about the coexistence of IE7 and IE8

I installed IE8 today. When I went to the Microso...

Detailed explanation of viewing and setting SQL Mode in MySQL

Viewing and Setting SQL Mode in MySQL MySQL can r...

Webpack builds scaffolding to package TypeScript code

Create a folder Directory structure: dabaots Init...

Related operations of adding and deleting indexes in mysql

Table of contents 1. The role of index 2. Creatin...

Linux MySQL root password forgotten solution

When using the MySQL database, if you have not lo...

How to try to add sticky effect to your CSS

Written in front I don’t know who first discovere...

Linux file management command example analysis [display, view, statistics, etc.]

This article describes the Linux file management ...

Example of how to create and run multiple MySQL containers in Docker

1. Use the mysql/mysql-server:latest image to qui...

Introduction to Semantic XHTML Tags

The first point to make is that people can judge t...