Linux服务器部署redis常见问题处理
redis开启和禁用登陆密码校验
1. 开启登陆密码校验
在redis-cli命令行工具中执行如下命令:
config set requirepass yourpassword
2. 禁用登陆密码校验
同上,需要在redis-cli中执行如下命令:
config set requirepass ""
----------------------------------
(error) DENIED Redis is running in protected mode because protected mode is enabled
Redis protected-mode 是3.2 之后加入的新特性,在Redis.conf的注释中,我们可以了解到,他的具体作用和启用条件
链接redis 时只能通过本地localhost (127.0.0.1)这个来链接,而不能用网络ip(192.168..)这个链接,问题然如果用网络ip 链接会报以下的错误:
(error) DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the lookback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the --portected-mode no option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.
是说处于保护模式,只能本地链接,我们需要修改配置文件../redis.conf
1)打开配置文件把下面对应的注释掉
# bind 127.0.0.1
2)Redis默认不是以守护进程的方式运行,可以通过该配置项修改,使用yes启用守护进程,设置为no
daemonize no
3)保护模式
protected-mode no
4)最后关键的是:
没反应应该是你启动服务端的时候没有带上配置文件。你可以./redis-server redis.conf
你配置好了,但要重新启动redis,如果还是报一样的错误,很可能是没有启动到配置文件,所以需要真正的和配置文件启动需要:
在redis.conf文件的当前目录下:
$ redis-server redis.conf
如果还是所某个端口已在使用,那么可能是有 后台程序在占用该端口,需要kill 掉该程序,重新带上配置文件。./redis-server redis.conf启动。
将含有”redis”关键词的进程杀死:
$ ps -ef | grep redis | awk ‘{print $2}’ | xargs kill -9
Linux服务器部署redis常见问题处理的更多相关文章
- linux服务器查看redis版本:
linux服务器查看redis版本:redis-server-v
- linux服务器部署tomcat和Nginx
项目需要,申请了三台测试机器,好在测试机里面光秃秃的什么都没有,我就可以好好的学习一把玩一把了!接下来以图文的形式讲一下我所碰到的坑以及小小的收获吧! 一.准备工作 首先你得有一台可以玩的linux服 ...
- Linux服务器部署系列之八—Sendmail篇
Sendmail是目前Linux系统下面用得最广的邮件系统之一,虽然它存在一些不足,不过,目前还是有不少公司在使用它.对它的学习,也能让我们更深的了解邮件系统的运作.下面我们就来看看sendmail邮 ...
- Linux服务器部署系列之七—OpenLDAP篇
LDAP(轻量级目录访问服务),通过配置这个服务,我们也可以在linux下面使用目录的形式管理用户,就像windows下面的AD一样,方便我们管理.下面我们就一起来配置openldap服务.本文运行环 ...
- Linux服务器部署系列之一—Apache篇(下)
接上篇 linux服务器部署系列之一—Apache篇(上) 四.管理日志文件 Apache日志分为访问日志和错误日志两种: 1)访问日志 用于记录客户端的访问信息,文件名默认为access_lo ...
- Linux服务器部署系列之二—MySQL篇
MySQL是linux环境中使用最广泛的数据库之一,著名的“LAMP黄金组合”就要用到MySQL.关于MySQL的优点及作用,我就不多讲了,网上很多这样的文章. 今天我们要谈的是MySQL服务器的部署 ...
- 如何在linux服务器部署Rstudio server,配置ODBC远程访问win 服务器上的SQL server
如何在linux服务器部署Rstudio server,配置ODBC后通过RODBC包远程访问SQL server 背景介绍:之前写过一篇文章,提到近期要部署Rstudio server(搭建数据分析 ...
- Linux服务器部署.Net Core笔记:目录
目录 Linux服务器部署.Net Core笔记:一.开启ssh服务 Linux服务器部署.Net Core笔记:二.安装FTP Linux服务器部署.Net Core笔记:三.安装.NetC ...
- linux离线部署redis及redis.conf详解
一.离线部署redis 由于博主部署的虚拟机没有网络也没有gcc编译器,所以就寻找具备gcc编译器的编译环境把redis编译安装好,Copy Redis安装目录文件夹到目标虚拟机的目录下.copy时r ...
随机推荐
- Flutter学习一之环境搭建
MacOS上搭建Flutter开发环境 1.flutter官网下载最新的安装包,https://flutter.io/sdk-archive/#macos 2.解压安装包到你想安装的目录.直接解压或者 ...
- 类加载器ClassLoader
上篇文章说到,Class类可以通过一个类的全限定名去加载类,那么底层是如何去加载的呢?这就是我们今天要聊的类加载器ClassLoader,其可以通过一个类的全限定名来获取描述此类的二进制字节流,也即是 ...
- 手写:javascript中的关键字new
简单介绍一下new new再熟悉不过了,new后面跟着构造函数,可以创建对象,这个对象的原型指向构造函数的原型对象,说起来可能有点绕,直接看代码吧 function Person(name, age) ...
- linux_基础调优
1. 配置授时服务,使用阿里云的授时服务 echo -e "# update time\n*/5 * * * * /usr/sbin/ntpdate time1.aliyun.com &am ...
- C++重载>>和<<(输入和输出运算符)详解
转载:http://c.biancheng.net/view/2311.html 在C++中,标准库本身已经对左移运算符<<和右移运算符>>分别进行了重载,使其能够用于不同数据 ...
- BSGS算法解析
前置芝士: 1.快速幂(用于求一个数的幂次方) 2.STL里的map(快速查找) 详解 BSGS 算法适用于解决高次同余方程 \(a^x\equiv b (mod p)\) 由费马小定理可得 x &l ...
- Inno Setup 5打包exe遇到的坑,做一个学习记录
; 脚本由 Inno Setup 脚本向导 生成!; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档! #define MyAppName "人员管理系统"#de ...
- ubuntu20 使用命令安装 nginx
安装 nginx sudo apt-get install nginx -y 配置文件 nginx 服务管理 # 启动 nginx 服务 service nginx start # 关闭 nginx ...
- 初探电波钟(A Brief Introduction Of Radio Controlled Clock AND Its Appliciations)
文档标识符:Radio_Controlled_Clock_T-D-P11 作者:DLHC 最后修改日期:2020.10.12 本文链接:https://www.cnblogs.com/DLHC-TEC ...
- ansible-playbook-jinja2管理nginx配置文件
1. 案例1:创建jinja2的nginx的主配置文件 1) 编写jinja2的nginx的主配置文件 1 [root@test-1 jinja2]# vim /ansible/jinja2/tes ...