标签:wget nts 文件 down 编译 mod logfile daemon run
wget http://download.redis.io/releases/redis-5.0.5.tar.gz
tar -zxvf redis-5.0.5.tar.gz
cd redis-5.0.5
make
sudo make PREFIX=/usr/local/redis install
cd /usr/local/redis
sudo cp /home/huck/Documents/redis-5.0.5/redis.conf ./
sudo vim redis.conf
将daemonize no改为 daemonize yes,(后台运行redis)
将 logfile "" 改为 logfile "/usr/local/redis/redis.log"(日志文件路径,自定义)
redis-server redis.conf
/usr/local/redis/bin/redis-server /usr/local/redis/redis.conf
查看是否启动成功ps -aux | grep redis
连接命令 -h 主机ip -p 端口
如果是本地连接,直接输入连接命令即可
/usr/local/redis/bin/redis-cli
/usr/local/redis/bin/redis-cli shutdown
方便启动客户端
将/usr/local/redis/bin/redis-cli
链接到/usr/local/bin
目录下
sudo ln /usr/local/redis/bin/redis-cli /usr/local/bin
方便启动服务端
在/usr/local/bin
下编写脚本redis_run.sh
用以启动redis服务
1
cd /usr/local/bin
2
sudo echo -e '#!/bin/bash\n`sudo /usr/local/redis/bin/redis-server /usr/local/redis/redis.conf`' > redis_run.sh
如果提示权限问题,请手动写入,内容如下
#!/bin/bash
`sudo /usr/local/redis/bin/redis-server /usr/local/redis/redis.conf`
3
sudo chmod +x redis_run.sh
以后启动redis服务时,可在任意目录下输入命令redis_run.sh
启动客户端时可在任意目录下输入redis-cli
标签:wget nts 文件 down 编译 mod logfile daemon run
原文地址:https://www.cnblogs.com/kainhuck/p/11438101.html