redis 安装

下载:https://redis.io/download

选择稳定版本

[root@localhost opt]# tar xvf redis-3.2.8.tar.gz

root@localhost opt]# cd redis-3.2.8

[root@localhost redis-3.2.8]# ls
00-RELEASENOTES  CONTRIBUTING  deps     Makefile   README.md   runtest          runtest-sentinel  src    utils
BUGS             COPYING       INSTALL  MANIFESTO  redis.conf  runtest-cluster  sentinel.conf     tests

直接make就可以了
[root@localhost redis-3.2.8]# make 
[root@localhost redis-3.2.8]# make PREFIX=/usr/local/redis install   #安装到指定目录
cd src && make install
make[1]: Entering directory `/opt/redis-3.2.8/src'

Hint: It's a good idea to run 'make test' ;)

    INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
make[1]: Leaving directory `/opt/redis-3.2.8/src'
[root@localhost bin]# pwd
/usr/local/redis/bin
[root@localhost bin]# ls -1
redis-benchmark         redis性能测试工具
redis-check-aof         检查aof日志工具
redis-check-rdb         检查rdb日志工具
redis-cli               连接用的客户端
redis-sentinel            
redis-server            redis服务进程
[root@localhost bin]#  cp /opt/redis-3.2.8/redis.conf  .
[root@localhost redis]#  ./bin/redis-server  ./bin/redis.conf 
7487:M 30 Mar 01:45:36.130 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 3.2.8 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 7487
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

7487:M 30 Mar 01:45:36.157 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
7487:M 30 Mar 01:45:36.157 # Server started, Redis version 3.2.8
7487:M 30 Mar 01:45:36.157 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
7487:M 30 Mar 01:45:36.157 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
7487:M 30 Mar 01:45:36.157 * The server is now ready to accept connections on port 6379
[root@localhost bin]# ./redis-cli 
127.0.0.1:6379> set name wwb
OK
127.0.0.1:6379> get name
"wwb"

让redis server后台运行

[root@localhost bin]# grep daemonize  redis.conf 
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
daemonize  yes
# When the server runs non daemonized, no pid file is created if none is
# specified in the configuration. When the server is daemonized, the pid file
# output for logging but daemonize, logs will be sent to /dev/null
[root@localhost redis]# ./bin/redis-server  ./bin/redis.conf 
[root@localhost redis]# netstat -nalp | grep redis
tcp        0      0 127.0.0.1:6379              0.0.0.0:*                   LISTEN      7538/./bin/redis-se 

 

转载于:https://www.cnblogs.com/weiwenbo/p/6646632.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值