Environment Installation Memo Redis

Source: Internet
Author: User
Tags redis cluster install redis

1.1. Configure Redis
    1. Setting up the redis installation directory

Mkdir/usr/local/redis

    1. Change Directory access permissions to tomcat users

Chown-r-V Tomcat/usr/local/redis

    1. Unzip the Redis source code package

TAR-XVF redis-3.0.1.tar.gz

    1. Compiling Redis

Enter the Redis source code to extract the directory and execute make

Execute make Test

Page Display Error:
You need TCL 8.5 or newer in order to run the Redis test
Make: * * * [Test] Error 1

Solution:

    1. wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
    2. TAR-XZVF tcl8.6.1-src.tar.gz-c/USR/LOCAL/TCL
    3. cd/usr/local/tcl8.6.1/unix/
    4. sudo./configure
    5. sudo make
    6. sudo make install

    1. Generating redis Executable Services

After make is successful, there are Some more executables in the SRC directory:redis-server,redis-cli and so on.

During the convenient period, the CP command is copied to the usr directory for operation.

CP redis-server/usr/local/bin/

CP redis-cli/usr/local/bin/

Then create a new directory, store the configuration file

Mkdir/etc/redis

Mkdir/var/redis

Mkdir/var/redis/log

Mkdir/var/redis/run

mkdir/var/redis/6379

Mkdir/var/redis/data

    1. Redis Environment Configuration

Locate the profile template in the redis solution directory and copy it to the following location.

Adjust Redis service ports to suit your situation

CP redis.conf/etc/redis/6379.conf

Modify 6379.conf with vim command

Daemonize Yes

Pidfile/var/redis/run/redis_6379.pid

Logfile/var/redis/log/redis_6379.log

dir/var/redis/6379

    1. Redis cluster environment

Clustered Ruby Installation

Yum Install Ruby

Yum Install RubyGems

Gem Install Redis

Cluster environment Configuration variables

Redis cluster environments require a minimum of 6 service applications.

3 Master ports:6380,6381,6382

3 x slaver ports:16380,16381,16382

Start and initialize the cluster

Server 1

/usr/local/bin/redis-server/etc/redis/6380.conf >/var/redis/log/redis-6380.log 2>&1 &

/usr/local/bin/redis-server/etc/redis/6381.conf >/var/redis/log/redis-6381.log 2>&1 &

/usr/local/bin/redis-server/etc/redis/16382.conf >/var/redis/log/redis-16382.log 2>&1 &

Server 2

/usr/local/bin/redis-server/etc/redis/6382.conf >/var/redis/log/redis-6382.log 2>&1 &

/usr/local/bin/redis-server/etc/redis/16380.conf >/var/redis/log/redis-16380.log 2>&1 &

/usr/local/bin/redis-server/etc/redis/16381.conf >/var/redis/log/redis-16381.log 2>&1 &

Start the cluster

/USR/LOCAL/BIN/REDIS-TRIB.RB Create--replicas 1 192.168.1.231:6380 192.168.1.231:6381 192.168.1.233:6382 192.168.1.233:16380 192.168.1.233:16381 192.168.1.231:16382

Related references

http://blog.csdn.net/xu470438000/article/details/42971091

http://blog.csdn.net/myrainblues/article/details/25881535

    1. Redis Start and stop

Start: redis-server/etc/redis/6379.conf

Stop: REDIS-CLI shutdown

    1. Redis Common Command Reference

http://blog.csdn.net/yhl27/article/details/9936189

Environment Installation Memo Redis

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.