1、检查安装依赖程序

yum install gcc-c++
yum install -y tcl
yum install wget

2、获取安装文件

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

3、解压文件

tar -xzvf redis-2.8.19.tar.gz
mv redis-2.8.19 /usr/local/redis

4、进入目录

cd /usr/local/redis

5、编译安装

make
make install

6、设置配置文件路径

mkdir -p /etc/redis
cp redis.conf/etc/redis

7、修改配置文件

vi /etc/redis/redis.conf
仅修改: daemonize yes (no-->yes)

8、启动

/usr/local/bin/redis-server /etc/redis/redis.conf

9、查看启动

ps -ef | grep redis 

10、使用客户端

redis-cli
>set name david
OK
>get name
"david"

11.关闭客户端

redis-cli shutdown

12、开机启动配置

echo "/usr/local/bin/redis-server /etc/redis/redis.conf &" >> /etc/rc.local

开机启动要配置在 rc.local 中,而 /etc/profile 文件,要有用户登录了,才会被执行。

相关文章:

  • 2021-09-21
  • 2021-04-13
  • 2021-12-12
  • 2021-09-24
  • 2021-12-13
  • 2022-01-04
  • 2021-09-23
猜你喜欢
  • 2021-08-01
  • 2021-07-01
  • 2021-06-29
  • 2022-02-09
  • 2022-12-23
  • 2021-09-01
相关资源
相似解决方案