Linux Installation Redis Service

Source: Internet
Author: User
Tags benchmark

Installation
Cd/root/downloadwget http://download.redis.io/releases/redis-3.0.7.tar.gzTar xzf Redis-3.0. 7.Tar.GZCD Redis-3.0. 7makemkdir/usr/Local/redis#redis-server, Redis-benchmark, Redis-cliIn Redis-3.0. 7Under/SRC, Redis.Conf in Redis-3.0. 7Under CP Redis-server/usr/Local/REDISCP Redis-benchmark/usr/Local/REDISCP Redis-cli/usr/Local/REDISCP Redis.conf/usr/Local/rediscd/usr/Local/redis
Start (port number defaults to 6379)
#添加&符号是为了让服务在后台运行redis-server redis.conf &
Detection
#使用`redis-cli`客户端检测连接是否正常./redis-cli#如果更改了端口,使用`redis-cli`客户端连接时,也需要指定端口,例如:#./redis-cli -p 6380127.0.0.1:6379set)127.0.0.1:6379set"hello world"OK127.0.0.1:6379get key"hello world"
Stop it
#使用客户端redis-cli shutdown
Master-Slave configuration

1, the above installed a redis as master, and then use the VMware virtual machine cloning function to clone just that Linux system as a slave, and modify its IP to 192.168.1.101 (master-ip:100,slave-ip : 101).
2. Modify the Redis configuration file for slave:
slaveof 192.168.1.7 6379 (mapped to the primary server)
If Master sets the authentication password, you also need to configure Masterauth,eg:masterauth admin. If you do not set a password, you do not need to configure it.
After configuring the Redis service to start slave, OK, master and slave configuration is complete.
Test it below:
Perform the info command on the master and Slave clients (REDIS-CLI) to see the results as follows:
Master

Slave

Then execute set age 24 in master
Perform get age on slave to see if you can get 24 and if you can get the value then the configuration is successful.

Linux Installation Redis Service

Related Article

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.