redis安装

  1. [root@test-01 ~]# yum -y install gcc-c++ tclx
  2. [root@test-01 ~]# cd /data/
  3. [root@test-01 data]# wget http://download.redis.io/redis-stable.tar.gz
  4. [root@test-01 data]# tar -zxf redis-stable.tar.gz
  5. [root@test-01 data]# cd redis-stable
  6. [root@test-01 redis-stable]# make MALLOC=libc
  7. [root@test-01 redis-stable]# make test
  8. [root@test-01 redis-stable]# make install
  9. [root@test-01 redis-stable]# mkdir /etc/redis
  10. [root@test-01 redis-stable]# cp redis.conf /etc/redis/6379.conf
修改配置文件以下参数:
  1. [root@test-01 redis-stable]# vim /etc/redis/6379.conf
  2. 参数 说明
  3. daemonize yes 使Redis以守护进程模式运行
  4. pidfile /var/run/redis_端口号.pid 设置RedisPID文件位置
  5. port 端口号 设置Redis监听的端口号
  6. dir /var/redis/端口号 设置持久化文件存放位置
创建持久化文件存放目录
  1. [root@test-01 redis-stable]# mkdir -p /var/redis/6379
启动redis
  1. [root@test-01 redis-stable]# redis-server /etc/redis/6379.conf




原文地址:https://www.cnblogs.com/CongZhang/p/5390532.html