Cent7OS安装Redis
类型:Software
创建时间:2021-11-18 11:04:52
更新时间:2021-11-18 11:09:12
类型:Software
更新时间:2021-11-18 11:09:12
Cent7OS仓库中不包含Redis,我们需要从官网下载并编译安装
- 官网下载地址:https://redis.io/download
安装步骤如下
- 选择下载stable版本到/tmp/redis目录下
- 解压至/tmp/redis目录下编译执行
- 安装到/usr/local/redis目录下
- 复制/tmp/redis/redis6.2.6/redis.conf文件至安装目录/usr/local/redis/bin/下
- 修改/usr/local/redis/redis.conf文件,让redis以守护进程(后台进程)运行
- 运行redis即可
目录结构
- 下载目录:/tmp/redis
- 解压后redis源文件:/tmp/redis/redis6.2.6
- 安装目录:/usr/local/redis
下面是安装过程
编译安装如下
sudo yum install gcc
mkdir /tmp/redis
cd /tmp/redis
wget https://download.redis.io/releases/redis-6.2.6.tar.gz
tar -zxvf redis-6.2.6.tar.gz
cd /tmp/redis/redis-6.2.6
make MALLOC=libc
make install PREFIX=/usr/local/redis
复制conf文件
cp /tmp/redis-6.2.6/redis.conf /usr/local/redis/bin/
编辑conf文件并修改 daemonize
和requirepass
两个参数(后台运行和连接密码)
vim /usr/local/redis/bin/redis.conf
# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be
# started with the file path as first argument:
...
daemonize yes
...
requirepass your_passwd
直接运行即可
/usr/local/redis/bin/redis-server /usr/local/redis/bin/redis.conf
[[replyMessage== null?"发表评论":"@" + replyMessage.m_author]]
account_circle
email
web_asset
textsms
评论列表([[messageResponse.total]])
[[messageItem.m_author]]
[[messageItem.m_author]]
[[getEnviron(messageItem.m_environ)]]
[[subMessage.m_author]]
[[subMessage.m_author]]
@
[[subMessage.parent_message.m_author]]
[[subMessage.parent_message.m_author]]
[[getEnviron(messageItem.m_environ)]]