Tag Archives: redis

Linux Command Error: Redis (error) NOAUTH Authentication required

The authentication problem occurs because redis has set the authentication password
after startup, enter the following command:

127.0.0.1:6379> auth yourpassword

My password is redis123

127.0.0.1:6379> set name hello
(error) NOAUTH Authentication required.
127.0.0.1:6379> (error) NOAUTH Authentication required.
(error) ERR unknown command '(error)'
127.0.0.1:6379> auth redis123
ok

Redis can be operated normally.

[Solved] Redis Error: Error condition on socket for SYNC: No route to host

When we set up redis master-slave replication, we may encounter the following problems due to various problems:
error condition on socket for Sync: no route to host

Solution:

First, modify the related configurations in redis.conf:

#Original configuration
bind 127.0.0.1
#Modify to
bind 0.0.0.0
# Although it is said that commenting it out can also solve the above problem, it is not recommended to comment out this method. Because another problem will occur.
#or comment it out
#bind 127.0.0.1

Turn off the firewall of the host. Note: it is the firewall of the host, and then restart the service.

In CentOS 7, systemctl stop firewalld turns off the firewall. Other versions can turn off the firewall through service iptables stop.

Turn off the firewall:

 systemctl stop firewalld

Turn off redis service

ps -ef |grep -i redis # Find a process

kill -9 3667 #Shut down the process

Restart related services

Euopenler 21.09 sudo Yum Update Error: Errors during downloading metadata for repository ‘EPOL’

openEuler
openEuler-21.09-everything-x86_64-dvd.iso
sudo yum update error

EPOL
Errors during downloading metadata for repository 'EPOL':
	-Status code: 404 for htpp://repo.openeuler.org/openEuler-21.09/EPOL/repomd.xml

Please note that:

sudo vi/etc/yum.rest.d/openeuler.repo

Please note that

[EPOL]
name=EPOL
baseurl=http://repo.openeuler.org/openEuler-21.09/EPOL/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-21.09/OS/$basearch/RPM-GPG-KEY-openEuler

The correct address is:

name=EPOL
baseurl= http://repo.openeuler.org/openEuler-21.09/EPOL/main/ $basearch/

Save, exit and execute again.

Client Error: Could not get a resource from the pool [How to Solve]

Client error: could not get a resource from the pool

1. Reason & Solution

Concurrency is indeed too high, and the link pool configuration parameters are unreasonable. Solution: adjust the configuration parameters; The execution queue of the capacity expansion node redis is occupied by a large number of operations or time-consuming operations. Solution: optimize slow operations; Slow operation is prohibited. There is a hot key solution: split the key and distribute the pressure to each redis node; Increase the local memory. First check the local memory, and then go to a node in redis. The link pool is exhausted. Solution: solve the problem of data skew, execute time-consuming commands, resulting in Ping timeout. Solution: disable time-consuming commands, such as: keys *; Optimize the time-consuming operation. There is a bug in the lower version of jedis package. Solution: upgrade the jedis version

2. Hot key scene sorting

Question 01:

Frequent IP access in a region

Solution:

Increase the application local cache and LRU maintain a certain number of hot IP addresses

Question 02:

Frequently query a large Zset set

Solution:

Split by business dimension; Split by data number segment

3. Sort out the scenario when a node’s link pool is exhausted

Homicide caused by hashtag abuse

Redis Error: HandleServiceCommands: system error caught. error code=1056, message = StartService failed:

An error occurred when starting redis: # handleservicecommands: system error thought. Error code = 1056, message = startservice failed: unknown error
in fact, the current redis server has been started, and then an error is reported when you start it again. Just turn off and restart.

redis-server --service-stop

redis-server --service-start

redis-cli.exe -h 127.0.0.1 -p 6379

Error: Java: error: release version 5 not supported solution to run error

Error reporting reason

Java compiler setting error in project structure or setting

resolvent

1. Project structure
Click f I l e → P R O j e c t s t r u c t u r e file \ rightarrow project structurefile → projectstructure

Ensure that the SDK versions under project are the same

2、Preferences

    Click setting in preferences (or win version) to search java compiler and ensure that the target byte code
    version is the same as the selected version

How to Solve Redis Cluster Build Error

error 1

WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128
The length of the largest listening queue of each port does not meet this high-load environment and needs to be adjusted

Solution:echo 2048 > /proc/sys/net/core/somaxconn

error 2

WARNING overcommit_memory is set to 0! Background save may fail under low memory condition
Memory excess warning, setting the current memory to 0 will cause the background save to fail

Solution:
echo "vm.overcommit_memory=1" > /etc/sysctl.conf
#Refresh the configuration file to ensure it takes effect
sysctl vm.overcommit_memory=1

error 3

WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis
Enabling transparent huge page (THP) support in the kernel will cause Redis delays and memory usage issues

Solution:
echo never > /sys/kernel/mm/transparent_hugepage/enabled

error 4

Error condition on socket for SYNC: Connection reset by peer
The connection was refused because the main server may have bound its own IP address

Solution:

#Modify the master node configuration file
vim /etc/redis/6379.conf 
  bind 0.0.0.0							#Modify the listening address on line 70 to 0.0.0.0

[Solved] Redis executes the monitor command error: noauth authentication required

After redis is connected, a (error) noauth authentication required. error is returned after executing the monitor command

[root@m214 src]# ./redis-cli -p 6412
127.0.0.1:6412> monitor
(error) NOAUTH Authentication required.

The reason is that you did not log in with password authentication

Solution:
view the redis configuration file to see the corresponding pass.

# Generated by CONFIG REWRITE
masterauth "2651080c6814a4a9d62da69a12f962b6"
requirepass "2651080c6814a4a9d62da69a12f962b6"

Then, after logging in with redis cli, execute the command auth + password, and then execute the monitor command

[root@m214 src]# ./redis-cli -p 6412
127.0.0.1:6412> auth 2651080c6814a4a9d62da69a12f962b6
OK
127.0.0.1:6412> monitor
OK

[Solved] Redis Error: Unexpected exception while processing command

1. Background

Redis has been running for a long time, and an error is reported one day as follows:

2. Phenomenon

org.redisson.client.RedisException: Unexpected exception while processing command
at org.redisson.command.CommandAsyncService.convertException(CommandAsyncService.java:338)
at org.redisson.command.CommandAsyncService.get(CommandAsyncService.java:140)
at org.redisson.RedissonObject.get(RedissonObject.java:90)
at org.redisson.RedissonBucket.set(RedissonBucket.java:131)

3. Solution

Restart the Java application!

What exactly caused it,

You can only guess the link pool of the redis client. Due to network and other reasons, the redis client has not responded for a long time and collapsed!

perfect

Redis cli create creates an error when creating a cluster

Execute

Error message

Node 127.0.0.1:30001 is not configured as a cluster node

  Error reason:

/Cluster enabled yes is commented out in the root/soft/redis-5.0.5/redis.conf file  

Solution:

VI redis.conf uncomment and save.

Restart redis

If it still fails to start, refer to redis cluster tutorial – redis https://redis.io/topics/cluster-tutorial

Installation starts here

 

 

Redis Error: (error) NOAUTH Authentication required. [How to Solve]

This error is encountered in the redis interface

127.0.0.1:6379> select 0
(error) NOAUTH Authentication required.

This error is caused by lack of authorization. You can enter a password to solve it at this time.

127.0.0.1:6379> auth "your Password"

Or specify a password when accessing the ‘redis’ client

redis-cli -h 127.0.0.1 -p 6379 -a "your Password"