美文网首页
Redis6 环境搭建

Redis6 环境搭建

作者: 贪睡的企鹅 | 来源:发表于2020-10-21 15:00 被阅读0次

1 CentOS 7 安装

1.1 下载安装包
[root@localhost opt]# wget https://download.redis.io/releases/redis-6.0.8.tar.gz
1.2 解压安装包
[root@localhost opt]# tar -zxvf redis-6.0.8.tar.gz
1.3 安装gcc环境
yum -y install gcc   
yum -y install epel-release
# 查看gcc版本是否在5.3以上,centos7.6默认安装4.8.5
gcc -v
# 如果gcc版本4.8.5,需要手动升级gcc到5.3及以上升级到gcc 9.3:
yum -y install centos-release-scl
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
# 使用scl命令临时设置使用gcc 9.3版本(退出shell或重启就会恢复原系统gcc版本。)
scl enable devtoolset-9 bash
# 使用环境变量长期设置当前使用gcc 9.3版本
如果要长期使用gcc 9.3的话:
echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile
1.4 编译安装
# 编译出错时,清除编译生成的文件
make distclean
# 编译安装到指定目录下
make PREFIX=/usr/local/redis install 
# 卸载
make uninstal
1.5 拷贝配置文件到安装目录
[root@localhost redis-6.0.8]# cp redis.conf /usr/local/redis/bin
1.6 配置redis配置文件
# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
daemonize yes    # 设置后台启动
1.7 通过redis-server指定配置文件启动redis服务
[root@localhost bin]# ps -ef |grep redis
root      46371  38437  0 15:18 pts/0    00:00:00 grep --color=auto redi
[root@localhost bin]# ls
dump.rdb         redis-check-aof  redis-cli   redis-sentinel
redis-benchmark  redis-check-rdb  redis.conf  redis-server
[root@localhost bin]# sudo redis-server redis.conf 
[root@localhost bin]# ps -ef |grep redis
root      46401      1  0 15:18 ?        00:00:00 redis-server 127.0.0.1:6379
root      46410  38437  0 15:18 pts/0    00:00:00 grep --color=auto redi
1.8 通过redis-cli 客户端连接redis
[root@localhost bin]# sudo redis-cli -h 127.0.0.1 -p 6379
127.0.0.1:6379> 

相关文章

  • Redis6 环境搭建

    1 CentOS 7 安装 1.1 下载安装包 1.2 解压安装包 1.3 安装gcc环境 1.4 编译安...

  • CentOS7 安装 Redis6过程

    下载redis 环境准备 执行安装 配置环境变量 安装系统服务 这里Redis6版本有一个坑,需要先将instal...

  • React Native学习总结篇

    一、环境搭建 1.1 React Native环境搭建 1.1.1 IOS环境搭建 环境:MacOS 注意:不要使...

  • linux 第四天

    Lamp环境搭建 /*******************Lamp环境搭建:*******************...

  • codePush说明

    codePush环境搭建 环境搭建文章:环境搭建 git地址:codePush git地址2.0.3,And...

  • angular学习--02英雄指南

    环境搭建 angular官网--搭建本地开发环境和工作空间windows 10 搭建angular开发环境免搭建环...

  • Gradle开发-Groovy环境搭建

    ##Groovy环境搭建 在使用 Groovy 之前首先要搭建几个环境: Groovy 的环境搭建 JDK 环境搭...

  • redis6安装与配置详解

    安装 gcc版本问题避免 Redis是c语言开发的。安装redis需要c语言的编译环境。 安装redis6最主要的...

  • 搭建 LNMP + CodeIgniter 开发环境

    搭建 LNMP + CodeIgniter 开发环境搭建 LNMP 环境首先搭建 LNMP 的服务器环境安装 Ng...

  • iOS中RN与Flutter混合开发

    一 搭建环境 1. 搭建flutter环境 1.1 搭建系统开发环境 参考链接:https://flutter....

网友评论

      本文标题:Redis6 环境搭建

      本文链接:https://www.haomeiwen.com/subject/kexemktx.html