Linux redis configuration tutorial, linuxredis

Source: Internet
Author: User

Linux redis configuration tutorial, linuxredis

Redis-cli-h 127.0.0.1-p 6379? [-A passwprd] [-n database] set cli1 1? ? ---- Cli Command Execution

# RDB
Save 900 1 # When one Keys data is changed, refresh to Disk in 900 seconds. save 300 10 # When 10 Keys data is changed, refresh to Disk in 300 seconds save 60 10000 # When 10000 pieces of Keys data are changed, refresh to Disk in 60 seconds
# AOF
Appendonly yes ??????? # Enable AOF appendfilename ??????? # Saved file! There cannot be a path to appendfsync ?????????? # Always | everysec | no
No-appendfsync-on-rewrite yes ???????? # The auto-aof-rewrite-percentage 100 ?????? # When the size of the added file reaches 100% of the original AOF file, auto-aof-rewrite-min-size 64 mb ??????? # Minimum startup log rewriting Value

Redis-cli> info ????????????????

Find the last few lines:

Db0: the number of keys is: 11,

The memory usage is 891.52 kb.

# Master/Slave Configuration

MASTER: 6379, from 6380,6381

Cp/usr/local/redis cp/usr/local/redis_6380

Cp/usr/local/redis cp/usr/local/redis_6381

Modify redis. conf from 6380 and 6381: Configuration File

Vi? /Usr/local/redis_slave_6380/redis. conf

bind 127.0.0.1port 6380pidfile /var/run/redis_slave_6380.pidslave 127.0.0.7 63??? slave-read-only yesdir /usr/local/redis_slave_6380/data

Vi? /Usr/local/redis_slave_6381/redis. conf

bind 127.0.0.1port 6381pidfile /var/run/redis_salve_6381.pidslave 127.0.0.7 6379??? slave-read-only yesdir /usr/local/redis_slave_6381/data

Modify the sentinel. conf configuration from 6380 and 6381 :? (Ignore)

Vi? /Usr/local/redis_slave_6380/sentinal. con

port 26379????????????????????????????????????#The port that this sentinel instance will run osentinel monitor mymaster 127.0.0.1 6379 2????#

Info replication shows that 6380 is from

From server to master server:

Kill the server

Restart redis 66379

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.