Redis实现广告缓存

栏目: 数据库 · 发布时间: 7年前

内容简介:打开配置文件redis.conf,改为:将第三步配置好的配置文件复制到指定目录cp /usrlocal/redis-5.0.2/redis.conf /etc/redis/redis.conf

redis下载与安装

下载 redis 安装包及安装相关依赖包

下载最新稳定版的redis:

wget https://github.com/antirez/redis/archive/5.0.2.tar.gz

安装依赖包:

yum install -y epel-release

yum install -y gcc

解压及编译

cd /usr/local
tar -xzvf redis-5.0.2.tar.gz

编译:

cd redis-5.0.2

make & make install

修改配置文件

打开配置文件redis.conf,改为:

requirepass password
daemonize yes
logfile "/var/log/redis/6379.log"

设置启动服务

将第三步配置好的配置文件复制到指定目录

cp /usrlocal/redis-5.0.2/redis.conf /etc/redis/redis.conf

设置启动服务脚本

cat > /usr/lib/systemd/system/redis.service <<-EOF
[Unit]
Description=Redis 6379
After=syslog.target network.target
[Service]
Type=forking
PrivateTmp=yes
Restart=always
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli -h 127.0.0.1 -p 6379 -a jcon shutdown
User=root
Group=root
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=100000
[Install]
WantedBy=multi-user.target
EOF

使服务自动运行

systemctl daemon-reload
systemctl enable redis

启动服务

systemctl restart redis

systemctl status redis

验证

redis-cli -h host -p port -a password


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Heuristic Search

Heuristic Search

Stefan Edelkamp、Stefan Schrodl / Morgan Kaufmann / 2011-7-15 / USD 89.95

Search has been vital to artificial intelligence from the very beginning as a core technique in problem solving. The authors present a thorough overview of heuristic search with a balance of discussio......一起来看看 《Heuristic Search》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具