Install Redis 3.2.9 and centosredis in Centos 6.9

Source: Internet
Author: User

Install Redis 3.2.9 and centosredis in Centos 6.9

Dependent package and common package
Yum install gcc-c ++ make zlib-devel readline-devel tkutil tk tkutil-devel tk-devel openssl-devel wget vim ntp-y

Download redis
Wget http://download.redis.io/releases/redis-3.2.9.tar.gz

Decompress redis
Tar-zxvf redis-3.2.9.tar.gz

Rename redis
Music redis-3.2.9/usr/local/redis

Compile and install redis
Cd/usr/local/redis

Make & make install

Create a port
Cd/usr/local/redis/utils

Sh./install_server.sh
6379
Always Enter

Modify connection IP Address
Vi/etc/redis
62 bind IP

Redis directory structure
/Usr/local/redis
/Etc/redis
/Var/lib/redis

Redis Automatic startup (3.2.9 the default startup script/etc/init. d)
Chkconfig -- add redis_6379
Chkconfig redis_6379 on

 

View port status

Ps-ef | grep 6379

Netstat-lntp | grep 6379

Test

Redis-cli-h ip-p 6379

-------------------------------------------------------------------------------

Make:

(1) If the following prompt appears, it indicates that gcc is not installed. Run the command to install gcc: yum install gcc.

[root@localhost redis-2.8.17]# makecd src && make allmake[1]: Entering directory `/root/redis-2.8.17/src‘    CC adlist.o/bin/sh: cc: command not foundmake[1]: *** [adlist.o] Error 127make[1]: Leaving directory `/root/redis-2.8.17/src‘make: *** [all] Error 2

(2) If the following prompt appears, change make to make MALLOC = libc, presumably because of library compilation problems.

[root@localhost redis-2.8.17]# makecd src && make allmake[1]: Entering directory `/root/redis-2.8.17/src‘    CC adlist.oIn file included from adlist.c:34:zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directoryzmalloc.h:55:2: error: #error "Newer version of jemalloc required"make[1]: *** [adlist.o] Error 1make[1]: Leaving directory `/root/redis-2.8.17/src‘make: *** [all] Error 2

5. install the compiled file: make install. The redis executable file will be copied to/usr/local/bin/, but it is not configured. manually copy the configuration: cp redis. conf/usr/local/bin

6. Set the Redis password, edit the copied configuration file vi redis. conf, uncomment the requirepass parameter, and set the value, for example, requirepass ljx520.

7. Use the configuration file to start the Redis Database:./redis-server redis. conf

If you see the following interface, congratulations! Redis has been installed successfully.

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.