CentOS 8.2安装Redis6.0.6

 

安装gcc

#安装 gcc
[root@localhost /]# yum -y install gcc tcl
# 查看 gcc 版本是否在 5.3 以上,centos7.6 默认安装 4.8.5
[root@localhost /]# gcc -v

亲测CentOS8.2会自动安装8.4.1版本

安装

[root@localhost /]# cd /usr/local/
[root@localhost local]# wget http://download.redis.io/releases/redis-6.0.9.tar.gz
[root@localhost local]# tar -zxvf redis-6.0.9.tar.gz
[root@localhost local]# cd redis-6.0.9
[root@localhost redis-6.0.9]# make
# 编译安装到指定目录下
[root@localhost redis-6.0.9]# make PREFIX=/usr/local/redis install
[root@localhost redis-6.0.9]# cp redis.conf /usr/local/redis/bin/6379.conf

修改配置文件6379.conf

#bind 127.0.0.1 # 将这行代码注释,监听所有的ip地址,外网可以访问
protected-mode no # 把yes改成no,允许外网访问
daemonize yes # 把no改成yes,后台运行
appendonly yes # 开启aof备份

测试

[root@localhost redis-6.0.9]# cd /usr/local/redis/bin
[root@localhost redis]# ll
总用量 84
-rw-r--r--. 1 root root 84841 12月 19 22:57 6379.conf
drwxr-xr-x. 2 root root   134 12月 19 22:56 bin
[root@localhost redis]# ./redis-server 6379.conf 
51189:C 19 Dec 2020 22:57:22.206 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
51189:C 19 Dec 2020 22:57:22.206 # Redis version=6.0.9, bits=64, commit=00000000, modified=0, pid=51189, just started
51189:C 19 Dec 2020 22:57:22.206 # Configuration loaded
51189:M 19 Dec 2020 22:57:22.207 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 6.0.9 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 51189
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

51189:M 19 Dec 2020 22:57:22.208 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
51189:M 19 Dec 2020 22:57:22.208 # Server initialized
51189:M 19 Dec 2020 22:57:22.208 # 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.
51189:M 19 Dec 2020 22:57:22.208 # 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 madvise > /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 (set to 'madvise' or 'never').
51189:M 19 Dec 2020 22:57:22.209 * Ready to accept connections

 

posted @ 2021-11-10 15:47  isalo  阅读(83)  评论(0编辑  收藏  举报