CentOS 7 yum安装 Redis
2023-09-14 09:16:41 时间
1、下载fedora的epel仓库
yum install epel-release
2、安装redis数据库
yum install redis -y
3、启动redis
systemctl start redis # 启动redis
systemctl stop redis # 停止redis
systemctl status redis # 查看redis运行状态
ps -ef | grep redis # 查看redis进程
4、设置开机启动
systemctl enable redis
5、开放防火墙
vi /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --dport 6379 -j ACCEPT #添加
6、修改配置文件
vi /etc/redis.conf
################################## SECURITY ###################################
# Require clients to issue AUTH <PASSWORD> before processing any other
# commands. This might be useful in environments in which you do not trust
# others with access to the host running redis-server.
#
# This should stay commented out for backward compatibility and because most
# people do not need auth (e.g. they run their own servers).
#
# Warning: since Redis is pretty fast an outside user can try up to
# 150k passwords per second against a good box. This means that you should
# use a very strong password otherwise it will be very easy to break.
#
requirepass 123456 #修改密码 123456
# Command renaming.
#
# It is possible to change the name of dangerous commands in a shared
# environment. For instance the CONFIG command may be renamed into something
# hard to guess so that it will still be available for internal-use tools
# but not available for general clients.
# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
# internet, binding to all the interfaces is dangerous and will expose the
# instance to everybody on the internet. So by default we uncomment the
# following bind directive, that will force Redis to listen only into
# the IPv4 lookback interface address (this means Redis will be able to
# accept connections only from clients running into the same computer it
# is running).
#
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
添加注释,远程可以访问
# bind 127.0.0.1
# yes 改 no
protected-mode no
7、使用端口登陆
[root@centos7 ~] redis-cli -h 127.0.0.1 -p 6379 #测试
127.0.0.1:6379> ping #ping命令
(error) NOAUTH Authentication required. #提示输入密码
127.0.0.1:6379> auth 123456 #输入密码
OK #成功
相关文章
- 查看linux系统版本centos,CentOS下查看系统版本的4种方法
- Linux下安装redis_redis安装部署centos
- 如何在Win7上安装Redis(win7安装redis)
- 如何优化Redis缓存配置(redis缓存配置)
- Redis:易于安装的依赖包(redis 依赖包)
- 手机版Redis快速安装,轻松享受超高性能(手机版redis下载)
- 安装苹果电脑上的Redis服务器(苹果电脑redis安装)
- 成功检查Redis安装安装成功与否的结果(查看redis是否安装)
- 一步一步搭建用宝塔面板安装Redis(用宝塔安装redis)
- 值得一看深入理解 Redis 连接的清理方式(清理redis 链接)
- 更改Redis安装目录一步一步实现(更改redis的安装目录)
- 解决找不到Redis安装目录的困惑(找不到redis安装目录)
- Ubuntu下Redis的安装及环境配置(乌班图redis安装配置)
- 一图带你了解Redis从原理到实战(一图redis原理)
- 快速安装Win7系统上的Redis(win7怎么装redis)
- 单机Redis安装指南(单机redis安装)
- 华为云上一键部署Redis数据库(华为云安装redis)
- 如何快速高效地安装Redis(如何在安装redis)
- 深入剖析后端Redis缓存面试技巧(后端redis缓存面试)
- 重新配置Redis集群删除节点(redis集群去掉节点)
- 简单步骤手把手带你生成Redis配置文件YML(redis配置文件yml)
- Redis 中的未清理过期项目(redis 过期未清理)
- Redis处理null值研究(redis读取null)