[Solved] Redis Startup Error: FATAL CONFIG FILE ERROR

1.Redis Startup Error: Reading the configuration file, at line 194>>> ‘always-show-logo yes’Bad directive or wrong number of arguments
Error Messages:

[root@xxx-0001 src]# redis-server /etc/redis-cluster/redis-7001.conf
*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 194
>>> 'always-show-logo yes'
Bad directive or wrong number of arguments

Cause analysis:

Error means that the specified configuration file directory is wrong or the number of parameters in the configuration file is wrong
the reason is that redis-4.0 is installed for the first time At 8:00, the environment variable is written. When redis server is executed, it will first query whether this instruction is configured in the environment variable,
it is found that there is (or the old 4.0.8) However, the configuration file used is 5.0 To sum up, the redis server in the environment variable is imported from my previous version. If I change the version of redis, I can’t use the previously imported environment variable to execute

Solution:

From this point of view, the solution is clear:
method 1: re import the redis server of the new version of redis to the environment variable
method 2: directly use the redis server in the new version of redis to execute the startup command

Finally, let’s see the situation after the solution

[root@xxx-0001 src]# ./redis-server /etc/redis-cluster/redis-7001.conf
27895:C 06 Dec 2021 13:09:29.818 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
27895:C 06 Dec 2021 13:09:29.818 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=27895, just started
27895:C 06 Dec 2021 13:09:29.818 # Configuration loaded
[root@apm-0003 src]# ./redis-server /etc/redis-cluster/redis-7002.conf
27952:C 06 Dec 2021 13:09:37.218 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
27952:C 06 Dec 2021 13:09:37.218 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=27952, just started
27952:C 06 Dec 2021 13:09:37.218 # Configuration loaded
[root@apm-0003 src]# ./redis-server /etc/redis-cluster/redis-7003.conf
27996:C 06 Dec 2021 13:09:40.829 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
27996:C 06 Dec 2021 13:09:40.829 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=27996, just started
27996:C 06 Dec 2021 13:09:40.829 # Configuration loaded
[root@apm-0003 src]# ./redis-server /etc/redis-cluster/redis-7004.conf
28021:C 06 Dec 2021 13:09:43.651 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
28021:C 06 Dec 2021 13:09:43.651 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=28021, just started
28021:C 06 Dec 2021 13:09:43.651 # Configuration loaded
[root@apm-0003 src]# ./redis-server /etc/redis-cluster/redis-7005.conf
28065:C 06 Dec 2021 13:09:46.736 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
28065:C 06 Dec 2021 13:09:46.737 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=28065, just started
28065:C 06 Dec 2021 13:09:46.737 # Configuration loaded
[root@apm-0003 src]# ./redis-server /etc/redis-cluster/redis-7006.conf
28124:C 06 Dec 2021 13:09:50.963 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
28124:C 06 Dec 2021 13:09:50.963 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=28124, just started
28124:C 06 Dec 2021 13:09:50.963 # Configuration loaded
[root@xxx-0001 src]# ps -ef|grep redis
root      6227     1  0 12:35 ?       00:00:04 redis-server 0.0.0.0:6379
root     27896     1  0 13:09 ?       00:00:00 ./redis-server 0.0.0.0:7001 [cluster]
root     27953     1  0 13:09 ?       00:00:00 ./redis-server 0.0.0.0:7002 [cluster]
root     27998     1  0 13:09 ?       00:00:00 ./redis-server 0.0.0.0:7003 [cluster]
root     28022     1  0 13:09 ?       00:00:00 ./redis-server 0.0.0.0:7004 [cluster]
root     28066     1  0 13:09 ?       00:00:00 ./redis-server 0.0.0.0:7005 [cluster]
root     28125     1  0 13:09 ?       00:00:00 ./redis-server 0.0.0.0:7006 [cluster]
root     28276  4581  0 13:10 pts/4    00:00:00 grep --color=auto redis

Read More: