服务端redis 安装以及配置
2017-10-06 11:13
344 查看
环境 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一下
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一下
相关文章推荐
- linux上redis集群的安装以及redis.conf配置(去注释版)
- windows系统 windows7 windows10系统下安装和配置以及使用redis
- redis安装以及主从的简单配置测试
- redis安装配置以及集群配置
- Redis安装以及配置详解
- redis-linux 安装配置以及使用手册
- redis 的安装以及主从配置
- Ubuntu15中安装redis以及redis的简单配置
- Windows下redis安装以及配置
- inux redis 安装配置, 以及redis php扩展
- Linux下安装Redis以及配置远端访问
- redis-windows 安装配置以及使用手册
- Ubuntu安装redis并配置远程、密码以及开启php扩展
- Ubuntu安装redis并配置远程、密码以及开启php扩展
- 简单介绍redis以及ubuntu和windows下怎么安装redis和配置文件详解
- 如何快速掌握redis在centos上的安装和配置,以及常用命令
- redis之redis的安装,主从复制配置以及java客户端操作
- window下redis的安装以及php-redis详细配置