下载Redis

Redis----centOs7.4 __X64下配置和运行

wget http://download.redis.io/releases/redis-5.0.4.tar.gz

将下载的安装包解压

tar xzf redis-5.0.4.tar.gz

Redis----centOs7.4 __X64下配置和运行

安装gcc环境

由于redis是由C语言编写的,它的运行需要C环境,因此我们需要先安装gcc。

yum install gcc-c++

安装gcc 一路y下去 安装完成
Redis----centOs7.4 __X64下配置和运行

进入Redis解压的文件夹下进行编译

Redis----centOs7.4 __X64下配置和运行

Redis----centOs7.4 __X64下配置和运行
进入src目录执行 make test
Redis----centOs7.4 __X64下配置和运行
提示需要安装 tcl 8.5 或者更高版本

 yum install tcl

Redis----centOs7.4 __X64下配置和运行
安装完成
Redis----centOs7.4 __X64下配置和运行

执行 make test,会出现很多[ok]

执行成功
Redis----centOs7.4 __X64下配置和运行

执行安装redis

直接放到安装目录

 make install PREFIX=/usr/local/project/redis-5.0.4

直接会生成bin目录
Redis----centOs7.4 __X64下配置和运行

修改配置文件

后台显示运行 不显示运行状态
Redis----centOs7.4 __X64下配置和运行
关闭访问网段(设置集群时配置)
Redis----centOs7.4 __X64下配置和运行
远程访问开启
Redis----centOs7.4 __X64下配置和运行
设置redis密码
Redis----centOs7.4 __X64下配置和运行

运行Redis

运行Redis服务 加载配置文件

 ./redis-server  ../redis.conf

Redis----centOs7.4 __X64下配置和运行

将Redis端口让防火墙放行

  1. 执行如下命令命令
firewall-cmd --zone=public --add-port=6379/tcp --permanent
  1. 重启防火墙,运行命令:
firewall-cmd --reload
  1. 查看端口号是否开启,运行命令:
firewall-cmd --query-port=6379/tcp

访问成功

Redis----centOs7.4 __X64下配置和运行
Redis----centOs7.4 __X64下配置和运行

相关文章:

  • 2021-06-29
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2021-09-16
  • 2021-08-13
  • 2021-08-30
猜你喜欢
  • 2021-10-26
  • 2022-01-01
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2021-07-09
  • 2022-12-23
相关资源
相似解决方案