1、安装Centos
2、到Redis官网下载 Redis安装包
3、yum instal wget
4、cd~
5、mkdir soft
6、wget https://download.redis.io/releases/redis-6.2.4.tar.gz
7、tar xf redid-6.**.tar.gz
8、cf redis-6.***
9、vi README.md
10、编译:make,如果提示 /bin/sh: cc: 未找到命令,则执行第11,12,13步骤,如果没有提示则直接跳过
11、yun install gcc
12、make distclean
13、make 生成了可执行的程序
14、cd .. ///跳转到redis根目录
15、make install PREFIX=/opt/xufd/redis6
16、vi /etc/profile 添加path
export REDIS_HOME=/opt/xufd/redis6
export PATH=$PATH:$REDIS_HOME/bin
17、source /etc/profile 重新生成服务
18、切换到redis的根目录 cd /soft/redis/utils
19、./install_server.sh (可以进行多次执行,根据不同的port生成不同的redis实例) 如果提示如下的信息,则执行第20步骤,否则跳过:
20、vi ./instal_server.sh,注释如下信息
21、./install_server.sh
Welcome to the redis service installer
This script will help you easily set up a running redis server
Please select the redis port for this instance: [6379] 填写redis实例端口号,默认为6379,点击enter回车
22、Please select the redis config file name [/etc/redis/6379.conf] 填写redis配置文件目录,默认为端口号+.conf,点击Enter回车
23、Please select the redis log file name [/var/log/redis_6379.log] 填写redis日志文件目录,默认为端口号+.log,点击Enter回车
24、之后一路Enter回车,会将刚才所有填写的信息显示出来,如下
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379]
Selected default - /var/lib/redis/6379
Please select the redis executable path [/opt/xufd/redis6/bin/redis-server]
Selected config:
Port : 6379
Config file : /etc/redis/6379.conf
Log file : /var/log/redis_6379.log
Data dir : /var/lib/redis/6379
Executable : /opt/xufd/redis6/bin/redis-server
Cli Executable : /opt/xufd/redis6/bin/redis-cli
25、 确认是否安装,点击Enter,反之Ctrl+C
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful!
26、查看redis 所占用的进程,如图,表示6379实例运行在8862进行上,
ps -fe | grep redis
到此Centos安装Redis完成
后续进行Redis在Centos上的操作