首页 > 数据库 >CentOS7源码安装redis6

CentOS7源码安装redis6

时间:2023-01-03 18:26:06浏览次数:44  
标签:Jan -._ 03 redis6 18 CentOS7 源码 2023 _.-

CentOS7源码安装redis6

1.下载源码包

[root@localhost ~]# wget https://download.redis.io/releases/redis-6.2.8.tar.gz

2.安装依赖

  redis6需要gcc高版本

[root@localhost ~]# yum -y install centos-release-scl 
[root@localhost ~]# yum -y devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
[root@localhost ~]# scl enable devtoolset-9 bash (临时启用)
[root@localhost ~]# echo "source /opt/rh/devtoolset-9/enable" >> /etc/profile (永久启用)

3.解压安装

[root@localhost ~]# tar -xvf redis-6.2.8.tar.gz -C /usr/local/
[root@localhost ~]# cd /usr/local/redis-6.2.8/
[root@localhost ~]# make  && make install

 4.启动redis

[root@localhost redis-6.2.8]# /usr/local/redis/bin/redis-server 
38098:C 03 Jan 2023 18:07:02.299 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
38098:C 03 Jan 2023 18:07:02.299 # Redis version=6.2.8, bits=64, commit=00000000, modified=0, pid=38098, just started
38098:C 03 Jan 2023 18:07:02.299 # Warning: no config file specified, using the default config. In order to specify a config file use /usr/local/redis/bin/redis-server /path/to/redis.conf
38098:M 03 Jan 2023 18:07:02.299 * monotonic clock: POSIX clock_gettime
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 6.2.8 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                  
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 38098
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           https://redis.io       
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

38098:M 03 Jan 2023 18:07:02.300 # Server initialized
38098:M 03 Jan 2023 18:07:02.300 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. 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.
38098:M 03 Jan 2023 18:07:02.300 * Loading RDB produced by version 6.2.8
38098:M 03 Jan 2023 18:07:02.300 * RDB age 207 seconds
38098:M 03 Jan 2023 18:07:02.300 * RDB memory usage when created 0.77 Mb
38098:M 03 Jan 2023 18:07:02.300 # Done loading RDB, keys loaded: 0, keys expired: 0.
38098:M 03 Jan 2023 18:07:02.300 * DB loaded from disk: 0.000 seconds
38098:M 03 Jan 2023 18:07:02.300 * Ready to accept connections
^C38098:signal-handler (1672740433) Received SIGINT scheduling shutdown...
38098:M 03 Jan 2023 18:07:14.024 # User requested shutdown...
38098:M 03 Jan 2023 18:07:14.024 * Saving the final RDB snapshot before exiting.
38098:M 03 Jan 2023 18:07:14.025 * DB saved on disk
38098:M 03 Jan 2023 18:07:14.025 # Redis is now ready to exit, bye bye...

解决警告信息:

# 第一个警告的解决方法
echo net.core.somaxconn=511 >> /etc/sysctl.conf

# 第二个警告的解决方法
echo vm.overcommit_memory=1 >> /etc/sysctl.conf
# 使/etc/sysctl.conf生效
sysctl -p

# 第三个警告的解决方法
echo never > /sys/kernel/mm/transparent_hugepage/enabled

重新启动redis,正常

[root@localhost redis-6.2.8]# /usr/local/redis/bin/redis-server 
38105:C 03 Jan 2023 18:07:34.937 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
38105:C 03 Jan 2023 18:07:34.937 # Redis version=6.2.8, bits=64, commit=00000000, modified=0, pid=38105, just started
38105:C 03 Jan 2023 18:07:34.937 # Warning: no config file specified, using the default config. In order to specify a config file use /usr/local/redis/bin/redis-server /path/to/redis.conf
38105:M 03 Jan 2023 18:07:34.938 * monotonic clock: POSIX clock_gettime
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 6.2.8 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                  
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 38105
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           https://redis.io       
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

38105:M 03 Jan 2023 18:07:34.939 # Server initialized
38105:M 03 Jan 2023 18:07:34.939 * Loading RDB produced by version 6.2.8
38105:M 03 Jan 2023 18:07:34.939 * RDB age 20 seconds
38105:M 03 Jan 2023 18:07:34.939 * RDB memory usage when created 0.77 Mb
38105:M 03 Jan 2023 18:07:34.939 # Done loading RDB, keys loaded: 0, keys expired: 0.
38105:M 03 Jan 2023 18:07:34.939 * DB loaded from disk: 0.000 seconds
38105:M 03 Jan 2023 18:07:34.939 * Ready to accept connections
^C38105:signal-handler (1672740707) Received SIGINT scheduling shutdown...
38105:M 03 Jan 2023 18:11:47.471 # User requested shutdown...
38105:M 03 Jan 2023 18:11:47.471 * Saving the final RDB snapshot before exiting.
38105:M 03 Jan 2023 18:11:47.472 * DB saved on disk

 

标签:Jan,-._,03,redis6,18,CentOS7,源码,2023,_.-
From: https://www.cnblogs.com/haoee/p/17023052.html

相关文章

  • CentOS7部署tomcat10
    CentOS7部署tomcat10查看tomcat与jdk版本对应关系https://tomcat.apache.org/whichversion.html  一、先安装jdk 1.下载jdk    官网下载如有旧版本请先卸......
  • CentOS7源码安装jdk11
    CentOS7源码安装jdk111.下载jdk   官网下载如有旧版本请先卸载openjdk:[root@localhost~]#yumerase`rpm-qa|grepopenjdk`-y2.解压安装[root@localho......
  • flink orc hive 2.1.1 源码bug处理
    先说一下我们公司的线上集群配置: CDH6.3.1,hive2.1.1 ,由于公司是做车联网业务方向的,所以数据量很大,同事小A,在往集群写数据,发现写入的数据不能在hive表里查询,他写往......
  • JUC源码学习笔记7——FutureTask源码解析,人生亦如是,run起来才有结果
    系列文章目录和关于我一丶我们在哪里会使用到FutureTask基本上工作中和Future接口打交道比较多,比如线程池ThreadPoolExecutor#sumbit方法,返回值就是一个Future(实际上基......
  • 重新捋一捋React源码之更新渲染流程
    前言前些天在看DanAbramov个人博客(推荐阅读,站在React开发者的角度去解读一些API的设计初衷和最佳实践)里的一篇文章,其重点部分的思想就是即使不使用Memo(),也可以通过组合......
  • centos7 中 安装python 11
     001、查看系统[root@PC1~]#cat/etc/redhat-releaseCentOSLinuxrelease7.9.2009(Core)  002、安装环境依赖[root@PC1home]#yumgroupsmarkinstal......
  • 基于Springboot+SSM框架旅游系统项目开发与设计(附源码资料)-毕业设计
    1.项目简介这是一个Springboot旅游网站管理系统,管理员角色包含以下功能:管理员登录,用户管理,旅游路线管理,旅游景点管理,酒店管理,旅游攻略管理,车票管理,订单管理,数据分......
  • Centos7修改静态IP
    Centos7修改静态IP1、开启虚拟机,执行终端命令vim/etc/sysconfig/network-scripts/ifcfg-ens332、修改下面几个配置(没有的就添加)BOOTPROTO="static"//ip设置为静态......
  • Java个人家乡博客源码
    概述个人博客相册家乡主题,用户注册后可以发布关于家乡的特色文章介绍,可以发布照片,相册管理,留言,评论,回复,收藏,关注演示视频https://www.bilibili.com/video/BV1iy4y1x7w6......
  • Java人脸识别相册分类按时间分类相册按城市分类相册app源码
    简介后台Java,前台mui开发的androidapp;主要是按拍摄时间,人脸,城市进行相册照片的分类。演示视频https://www.bilibili.com/video/BV1XP4y187rA/?share_source=copy_web&v......