linux下redis安装和踩坑

1.下载安装包 (离线下载直接ftp到服务器)

wget http://download.redis.io/releases/redis-6.0.1.tar.gz

2.解压

tar -xzvf redis-6.0.1.tar.gz 

3.安装

[root@instance-6olzww4q redis-6.0.1]#cd redis-6.0.1/

[root@instance-6olzww4q redis-6.0.1]# make

[root@instance-6olzww4q redis-6.0.1]# make install

 3.1错误1 .解决 如果遇到以下错误命令未找到 

/bin/sh: cc: command not found
make[1]: *** [Makefile:293: adlist.o] Error 127
make[1]: Leaving directory '/root/redis-6.0.1/src'
make: *** [Makefile:6: all] Error 2

 安装 yum -y install gcc gcc-c++ libstdc++-devel

3.2错误2.解决

[root@instance-6olzww4q redis-6.0.1]# make install 
cd src && make install
make[1]: Entering directory '/root/redis-6.0.1/src'
    CC adlist.o
In file included from adlist.c:34:
zmalloc.h:50:10: fatal error: jemalloc/jemalloc.h: No such file or directory
 #include <jemalloc/jemalloc.h>
          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:293: adlist.o] Error 1
make[1]: Leaving directory '/root/redis-6.0.1/src'
make: *** [Makefile:9: install] Error 2

使用 make MALLOC=libc

4.设置密码 远程登陆

vi redis.conf 

#设置密码
# requirepass foobared
requirepass 123
#远程访问
#bind 127.0.0.1 
protected-mode no // yes->no
#后台启动
daemonize yes // no->yes

5启动 

[root@instance-6olzww4q src]# ./redis-server ../redis.conf
 
558:C 08 May 2020 08:56:48.711 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
558:C 08 May 2020 08:56:48.711 # Redis version=6.0.1, bits=64, commit=00000000, modified=0, pid=558, just started
558:C 08 May 2020 08:56:48.711 # Configuration loaded
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 6.0.1 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 558
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'     

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值