Installation and configuration of redis-3.2.6 under CentOS6.5

Source: Internet
Author: User
Tags redis version redis server

A. Experimental Environment

CentOS 6.5 x86_64

two. redis official website: https://redis.io/

three. preparing the software

[Email protected] ~]# wgethttp://download.redis.io/releases/redis-3.2.6.tar.gz

Four. installing Redis

    1. 1. Unzip

[Email protected] ~]# tar-zxvfredis-3.2.6.tar.gz

    1. 2. compiling

[Email protected] ~]# CD redis-3.2.6

[[email protected] redis-3.2.6]# make

    • Error:/bin/sh:cc:command not found

    • Workaround: Yum-yinstall gcc gcc-c++

1.3. to continue compiling, perform the make Distclean before doing

1.4. Compiling tests

[Email protected] redis-3.2.6]# maketest

    • Error: You NEEDTCL 8.5 or newer in order to run the Redis test

    • Workaround: Yum-yinstall tcl

1.5. continue compiling test, execute command make test

1.6. After the compilation is complete, there are some more files in the SRC directory under the current directory, such as

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/8B/B2/wKioL1hWMeXwFoOaAABgoXC336o122.png-wh_500x0-wm_3 -wmp_4-s_1212967612.png "title=" A.png "alt=" Wkiol1hwmexwfooaaabgoxc336o122.png-wh_50 "/>

    1. 7. Make Install , the purpose is to Redis-server, Redis-cli, redis-check-aof, Redis-check-dump and other files to the/usr/local/bin directory, you can also manually move

[Email protected] redis-3.2.6]# Makeinstall

    1. 8. View/usr/local/bin/

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/8B/B2/wKioL1hWM_rBWZHLAAA-FydsTDg257.png-wh_500x0-wm_3 -wmp_4-s_3591946029.png "title=" B.png "alt=" Wkiol1hwm_rbwzhlaaa-fydstdg257.png-wh_50 "/>

    1. 9. Review the Redis version to verify that the installation was successful

[Email protected] ~]# redis-server-v

Redis server v=3.2.6sha=00000000:0 malloc=jemalloc-4.0.3 bits=64 build=c44f26b41b545342

Five. Configure Redis

    1. 1. Create a Redis directory (not required)

This process is only for the purpose of managing Redis-related resources in a unified way.

[email protected] ~]# mkdir-p/usr/local/redis/etc used to store configuration files

[email protected] ~]# Mkdir-p/usr/local/redis/var used to store process files and log files

[email protected] ~]# Mkdir-p/usr/local/redis/data used to store data files

    1. 2. Modifying configuration files, setting parameters

Copy configuration file

[Email protected] redis-3.2.6]# cpredis.conf/usr/local/redis/etc/

Set the service to run after the daemon mode:

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/8B/B6/wKiom1hWNArzuU2qAAAeuRRBEtw311.png-wh_500x0-wm_3 -wmp_4-s_1113459486.png "title=" C.png "alt=" Wkiom1hwnarzuu2qaaaeurrbetw311.png-wh_50 "/>

Modify the PID directory to a new directory:

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/8B/B2/wKioL1hWNBWQsoEcAAAgiqLVRrk648.png-wh_500x0-wm_3 -wmp_4-s_2046284581.png "title=" D.png "alt=" Wkiol1hwnbwqsoecaaagiqlvrrk648.png-wh_50 "/>

Modify the log directory to a new directory:

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/8B/B2/wKioL1hWNCDRCGiKAAAreTghckI894.png-wh_500x0-wm_3 -wmp_4-s_2272391010.png "title=" E.png "alt=" Wkiol1hwncdrcgikaaaretghcki894.png-wh_50 "/>

Modify the data directory to a new directory:

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/8B/B6/wKiom1hWNCnS4a4TAAAUuBi9hl0271.png-wh_500x0-wm_3 -wmp_4-s_658166075.png "title=" F.png "alt=" Wkiom1hwncns4a4taaauubi9hl0271.png-wh_50 "/>

    1. 3. Start Redis Service

[Email protected] ~]# redis-server/usr/local/redis/etc/redis.conf

    1. 4. View the Redis process

[Email protected] ~]# Ps-ef | Grepredis

    1. 5. Client Connections

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/8B/B6/wKiom1hWNDLQvKBxAAAKJq2UVqU284.png-wh_500x0-wm_3 -wmp_4-s_3602681536.png "title=" G.png "alt=" Wkiom1hwndlqvkbxaaakjq2uvqu284.png-wh_50 "/>

Six. service scripts and boot-up

    1. 1. Copy the Redis boot script

[Email protected] redis-3.2.6]# Cputils/redis_init_script/etc/init.d/redis

    1. 2. Modifying startup Scripts

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/8B/B2/wKioL1hWNEODqPxSAAAeV-meheA729.png-wh_500x0-wm_3 -wmp_4-s_3862400750.png "title=" H.png "alt=" Wkiol1hwneodqpxsaaaev-mehea729.png-wh_50 "/>

    1. 3. Execute permissions for scripts

[Email protected] init.d]# chmod +xredis

    1. 4. Set boot up

[Email protected] ~]# chkconfig Redison

    • Error: Redis service does not support Chkconfig

    • Workaround: Add a message to the Redis service script


650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/8B/B6/wKiom1hWNHPQZXbJAAAMmmYzjMs979.png-wh_500x0-wm_3 -wmp_4-s_2613848155.png "title=" J.png "alt=" Wkiom1hwnhpqzxbjaaammmyzjms979.png-wh_50 "/>

    1. 5. perform chkconfig Redis on again, successfully.


At this point, the Redis installation configuration is complete!


This article from "Rookie of the World" blog, please be sure to keep this source http://guoxh.blog.51cto.com/10976315/1883729

Installation and configuration of redis-3.2.6 under CentOS6.5

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.