Redis solution (DENIED Redis is running in protected mode because Prote)

Source: Internet
Author: User
Tags install redis redis server






Previous Application log print error message:







There is no problem with the Telnet port and Ping on the app, so why not get the value?



Install a Redis client first to test: yum-y Install Redis



Redis-cli-h 192.168.32.12-p 6887



Then the error is:



(Error) DENIED Redis is running in protected mode because protected mode is ...






Later, you can view the configuration discovery redis.conf the line is also commented:



# Requirepass Foobared






Continue troubleshooting the discovery is related to a parameter configuration:





Redis can only be linked via local localhost (127.0.0.1), not network IP (192.168..). This link, the problem if you use the Network IP link will report the following error:
(Error) DENIED Redis is running in protected mode because protected mode are enabled, no bind address was specified, no authenticat Ion password is requested to clients. The This mode connections is only accepted from the Lookback interface. If you want-to-connect from external computers to Redis-adopt one of the following solutions:1) Just disable prot ected 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 are not publicly accessible from Internet if your 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 PROTECTE d 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 does one of the above things in order for the server to start accepting connections from the outside.
is said to be in protected mode, only local links, we need to modify the configuration file. /redis.conf

1) Open the configuration file and comment out the corresponding comments below
# bind 127.0.0.1

2) Redis default is not run as daemon, can be modified by this configuration item, use Yes to enable daemon, set to No
Daemonize No

3) Protection mode
Protected-mode No


Error Handling :



One



Remove comments from the corresponding configuration conf file and change Yes to No



#protected-mode Yes
Protected-mode No






Restart Redis (caution when data is available)



Kill-9 Process Number



Redis-cli-h 192.168.32.12-p 6887 shutdown






Second, add authentication, set the password



# Requirepass Foobared



Requirepass redis123456






Verify



Once again, use the Java program to establish the connection pool, no error, and the Redis server can be normal data processing. Program error log no longer displayed



Problem solving






This article is from the "7835882" blog, please be sure to keep this source http://crfsz.blog.51cto.com/7835882/1878137



Redis solution (DENIED Redis is running in protected mode because Prote)


Alibaba Cloud Hot Products

Elastic Compute Service (ECS) Dedicated Host (DDH) ApsaraDB RDS for MySQL (RDS) ApsaraDB for PolarDB(PolarDB) AnalyticDB for PostgreSQL (ADB for PG)
AnalyticDB for MySQL(ADB for MySQL) Data Transmission Service (DTS) Server Load Balancer (SLB) Global Accelerator (GA) Cloud Enterprise Network (CEN)
Object Storage Service (OSS) Content Delivery Network (CDN) Short Message Service (SMS) Container Service for Kubernetes (ACK) Data Lake Analytics (DLA)

ApsaraDB for Redis (Redis)

ApsaraDB for MongoDB (MongoDB) NAT Gateway VPN Gateway Cloud Firewall
Anti-DDoS Web Application Firewall (WAF) Log Service DataWorks MaxCompute
Elastic MapReduce (EMR) Elasticsearch

Alibaba Cloud Free Trail

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.