linux安装redis中出现的问题汇总

通过wget下载redis资源失败

  • 命令:wget http://download.redis.io/releases/redis-2.8.3.tar.gz
  • 描述:这一步是通过wget在redis官网中下载安装包,在这里失败了
  • 原因:虚拟机中刚安装的centOS,没有wget软件,安装一下就好
  • 解决:yum -y install wget

make安装解压完的redis安装包失败

  • 命令:make
  • 描述:make: cc: Command not found make: * [adlist.o] Error 127
  • 原因:没有安装gcc软件

- 解决:yum install gcc

make执行失败

  • 命令:make
  • 描述:
Selecting a non-default memory allocator when building Redis is done by setting    
the `MALLOC` environment variable. Redis is compiled and linked against libc    
malloc by default, with the exception of jemalloc being the default on Linux    
systems. This default was picked because jemalloc has proven to have fewer    
fragmentation problems than libc malloc.    

To force compiling against libc malloc, use:    

    % make MALLOC=libc    

To compile against jemalloc on Mac OS X systems, use:    

    % make MALLOC=jemalloc
  • 原因:分配器相关,具体未知
  • 解决:make MALLOC=libc

redis-cli输入后敲命令没有反应

  • 命令:./redis-cli
  • 描述:进入redis后敲命令回车没有任何反应
  • 原因:估计和server的启动方式有关
  • 解决:将配置文件 redis.conf 中的 “daemonize no” 这行配置改成 “daemonize yes”,然后redis启动服务的时候要带有配置文件的方式启动,不要用默认配置。如:”./redis-server ../redis.conf”。这个修改的配置是redis以守护进程的方式启动,改和不改有个明显的区别就是,不是守护进程启动(默认)启动,启动时可以看到redis的图形界面,而已守护进程的方式启动,则输入完以后没有反应直接到新的命令行。用 “ps a” 命令可以看到 “redis-server” 的进程已经启动

未完待续

猜你喜欢

转载自blog.csdn.net/ColdFireMan/article/details/80666648
今日推荐