内容简介:打开配置文件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
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
How to Solve It
Zbigniew Michalewicz、David B. Fogel / Springer / 2004-03-01 / USD 59.95
This book is the only source that provides comprehensive, current, and detailed information on problem solving using modern heuristics. It covers classic methods of optimization, including dynamic pro......一起来看看 《How to Solve It》 这本书的介绍吧!