安装redis,含安装步骤和安装中出现的详细错误分析
2015-12-07 17:19
645 查看
1.wget http://download.redis.io/releases/redis-2.8.13.tar.gz
2.解压文件
tar -zxvf redis-2.8.13.tar.gz
3.切换目录到 redis-2.8.13 目录下
cd redis-2.8.13
4.执行make命令
执行此步可能报错:错误1: make: cc: Command not found make: *** [adlist.o] Error 127
错误分析:linux中没有安装gcc环境
解决方法:# yum install gcc //安装gcc ; # rpm -qa |grep gcc //验证gcc是否安装成功
错误2:zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
makezmalloc.h:55:2: error: #error "Newer version of jemalloc required"
错误分析:关于分配器allocator, 如果有MALLOC 这个 环境变量, 会有用这个环境变量的 去建立Redis。错误分析:
而且libc 并不是默认的 分配器, 默认的是 jemalloc, 因为 jemalloc 被证明 有更少的 fragmentation problems 比libc。
但是如果你又没有jemalloc 而只有 libc 当然 make 出错。 所以加这么一个参数。
解决办法:make MALLOC=libc
5.执行make install命令,将可执行程序复制到/usr/local/bin下,以便以后执行程序可以不输入完整路径
6.执行make test命令,测试编译是否正确
执行此步可能报错:错误1:You need tcl 8.5 or newer in order to run the Redis test
错误分析:make test脚本是tcl脚本,需要安装tcl解释器
解决方法:1.wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
2.tar -xzvf tcl8.6.1-src.tar.gz
3. cd /tcl8.6.1/unix/
4 ./configure
5. make
6. make install
7.添加密码验证
在redis解压目录中,找到redis.conf文件,编辑这个文件,去掉#requirepass foobared之前的#号,改成自定义的密码如:requirepass test123;
执行redis-cli shutdown、redis-server ./redis.conf。
如果在启动时只用redis-server,不用redis-server ./redis.conf , 则在./redis.conf中配置的密码将失效。
2.解压文件
tar -zxvf redis-2.8.13.tar.gz
3.切换目录到 redis-2.8.13 目录下
cd redis-2.8.13
4.执行make命令
执行此步可能报错:错误1: make: cc: Command not found make: *** [adlist.o] Error 127
错误分析:linux中没有安装gcc环境
解决方法:# yum install gcc //安装gcc ; # rpm -qa |grep gcc //验证gcc是否安装成功
错误2:zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
makezmalloc.h:55:2: error: #error "Newer version of jemalloc required"
错误分析:关于分配器allocator, 如果有MALLOC 这个 环境变量, 会有用这个环境变量的 去建立Redis。错误分析:
而且libc 并不是默认的 分配器, 默认的是 jemalloc, 因为 jemalloc 被证明 有更少的 fragmentation problems 比libc。
但是如果你又没有jemalloc 而只有 libc 当然 make 出错。 所以加这么一个参数。
解决办法:make MALLOC=libc
5.执行make install命令,将可执行程序复制到/usr/local/bin下,以便以后执行程序可以不输入完整路径
6.执行make test命令,测试编译是否正确
执行此步可能报错:错误1:You need tcl 8.5 or newer in order to run the Redis test
错误分析:make test脚本是tcl脚本,需要安装tcl解释器
解决方法:1.wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
2.tar -xzvf tcl8.6.1-src.tar.gz
3. cd /tcl8.6.1/unix/
4 ./configure
5. make
6. make install
7.添加密码验证
在redis解压目录中,找到redis.conf文件,编辑这个文件,去掉#requirepass foobared之前的#号,改成自定义的密码如:requirepass test123;
执行redis-cli shutdown、redis-server ./redis.conf。
如果在启动时只用redis-server,不用redis-server ./redis.conf , 则在./redis.conf中配置的密码将失效。
相关文章推荐
- C#操作redis代码汇总
- Redis上实现分布式锁以提高性能的方案研究
- kafka zookeeper redis 搭建
- Redis缓存全自动安装shell脚本
- Windows上部署Redis-植入Windows服务
- redis-cli 命令总结
- 执行redis-trib.rb时遇到的问题
- Redis主从配置
- redis
- Redis安装部署
- redis(5)、redis最大缓存设置策略
- Redis源码分析-内存分配
- 关于Redis数据过期策略
- Redis "MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk"问题的解决
- Redis高级进阶(二)
- redis安装后提示权限问题ERR operation not permitted
- Redis配置讲解
- Redis安装部署
- 安装phpredis
- python:redis简单操作