当前位置:   article > 正文

Redis 离线安装(Linux版)_linux安装redis离线安装包

linux安装redis离线安装包

Linux 离线安装Redis

1、下载Redis

下载地址:https://download.redis.io/releases/redis-4.0.10.tar.gz

2、安装C语言编译环境

[root@master ~]#

yum install -y centos-release-scl scl-utils-build
yum install -y devtoolset-8-toolchain
  • 1
  • 2

3、使用gcc8

[root@master ~]#

scl enable devtoolset-8 bash
  • 1

4、查看gcc版本

[root@master ~]#

gcc  --version
  • 1

输出结果:

gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  • 1
  • 2
  • 3
  • 4

5、解压redis

[root@master ~]#

 tar -xzvf /chinaskills/redis-4.0.10.tar.gz -C /usr/local/src/ 
  • 1

6、重命名

[root@master ~]#

mv /usr/local/src/redis-4.0.10 /usr/local/src/redis
  • 1

8、进入解压目录进行make

[root@master ~]#

cd /usr/local/src/redis/
make
  • 1
  • 2

9、跳过make test 继续make install

[root@master ~]#

make install 
  • 1

10、加载环境变量

[root@master ~]#

source /etc/profile
  • 1

11、启动redis服务

[root@master ~]#

redis-server
  • 1
45148:C 19 Oct 19:00:28.594 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
45148:C 19 Oct 19:00:28.594 # Redis version=4.0.10, bits=64, commit=00000000, modified=0, pid=45148, just started
45148:C 19 Oct 19:00:28.594 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
45148:M 19 Oct 19:00:28.595 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 4.0.10 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 45148
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

45148:M 19 Oct 19:00:28.596 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
45148:M 19 Oct 19:00:28.596 # Server initialized
45148:M 19 Oct 19:00:28.597 # 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.
45148:M 19 Oct 19:00:28.597 # 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.
45148:M 19 Oct 19:00:28.597 * Ready to accept connections
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27

12、redis配置

[root@master ~]#

vi /usr/local/src/redis/redis.conf
  • 1

配置内容:

bind 0.0.0.0
# 设置redis服务后台启动
daemonize yes
  • 1
  • 2
  • 3

13、启动redis服务

[root@master ~]#

redis-server /usr/local/src/redis/redis.conf
  • 1

输出信息:

45202:C 19 Oct 19:19:24.314 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
45202:C 19 Oct 19:19:24.314 # Redis version=4.0.10, bits=64, commit=00000000, modified=0, pid=45202, just started
45202:C 19 Oct 19:19:24.314 # Configuration loaded
  • 1
  • 2
  • 3
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/636023
推荐阅读
相关标签
  

闽ICP备14008679号