centos之redis安装

1、解压

wget http://download.redis.io/releases/redis-4.0.6.tar.gz
tar -zxvf redis-4.0.6.tar.gz

2、yum安装gcc依赖

yum install gcc

3、编译安装

cd redis-4.0.6

make MALLOC=libc

cd src && make install

4、以后台进程方式启动redis

vim redis.conf


#daemonize yes
#bind 127.0.0.1
#protected-mode no

 

cd /etc
mkdir redis
cp /***/redis-4.0.6/redis.conf /etc/redis/6379.conf
cp /***/redis-4.0.6/utils/redis_init_script /etc/init.d/redisd
cd /etc/init.d

vim redisd #头两行添加
# chkconfig:   2345 90 10
# description:  Redis is a persistent key-value database


chkconfig redisd on

service redisd start#启动
service redisd stop#关闭 

 

你可能感兴趣的:(学习笔记,centos,redis)