服务端redis 安装以及配置
来源:互联网 发布:sap hana sql 编辑:程序博客网 时间:2024/06/05 14:45
环境 Ubuntu vmware
1、下载redis
登录redis官网获取下载链接
打开终端 使用如下命令下载redis压缩包
wget + 压缩包地址
2、解压
tar zxvf redis-*.tar.gz
3、编译
进入解压后的redis目录使用如下命令
make
4、安装到指定路径
make PREFIX=/usr/local/redis install
5、拷贝配置文件
将解压目录中的redis.conf配置文件拷贝到安装目录中的redis下
cp redis解压目录中配置文件位置 安装redis目录
6、编辑配置文件
daemonize no 设置为 yes
ps:只读模式修改
chmod a+w 文件名
7、加载配置文件并启动redis
./bin/redis-server ./redis.conf
8、停止redis
./bin/redis-cli shutdown
9、日志配置
redis默认不会保存日志,异常的时候会在控制台输出一个简单的错误堆栈信息
编辑redis.conf文件,定位到logfile属性,在后面的""中填上你的日志路径
# Specify the log file name. Also the empty string can be used to force
# Redis to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
logfile "/home/liupan/redis/redis/bin/redis.log"
备注:
关闭redis的时候可能会报错,查看日志文件详细信息
30145:M 25 Oct 11:22:53.681 # User requested shutdown...
30145:M 25 Oct 11:22:53.681 * Saving the final RDB snapshot before exiting.
30145:M 25 Oct 11:22:53.682 # Failed opening the RDB file dump.rdb (in server root dir /home/liupan/redis/redis/bin) for saving: Permission denied
30145:M 25 Oct 11:22:53.682 # Error trying to save the DB, can't exit.
大意是关闭redis的时候会保存一个dump文件,而你的redis可执行文件不能在bin目录下新建一个dump文件。
解决方法:
1、使用管理员角色来启动redis
sudo ./redis-server ./redis.conf
2、更改bin文件夹的权限(有点坑,更改bin目录下的所有文件的用户名用户组一点用都没有,因为bin文件夹归属是root,你用当前用户跑的redis根本不能再root文件夹下新建dump文件)
chown 用户:用户组 bin/
个人推荐第二种,Ubuntu无法以root身份登录,每次执行都要sudo一下
阅读全文
0 0
- 服务端redis 安装以及配置
- redis安装以及配置
- Redis的安装以及配置
- Redis 以及 phpredis 安装配置
- Redis安装以及配置详解
- Redis服务端配置总结
- redis安装配置以及集群配置
- redis服务端的安装
- Redis的服务端安装
- redis-windows 安装配置以及使用手册
- redis-linux 安装配置以及使用手册
- window下安装redis以及配置phpredis
- redis 的安装以及主从配置
- WIN Redis的安装教程以及配置
- redis安装以及配置主从文档
- MongDB在linux服务端配置安装以及数据备份
- linux redis 安装配置, 以及redis php扩展
- linux redis 安装配置, 以及redis php扩展
- Excle"自Access"导入Access数据没反应
- 集合框架(一)
- SSH组合工程之-struts2&hibernate&spring(工程下载)
- bzoj 3198: [Sdoi2013]spring hash+容斥原理
- inno setup在代码区域随意删除文件
- 服务端redis 安装以及配置
- python随机访问二进制文件
- haha
- Android 性能微型优化建议
- 左旋转字符串java实现
- 栈和队列基础面试题
- spring mvc入门
- 232电平与TTL电平
- Servlet入门