Redis service failed to start, prompt: redis server: command not found

Under the Linux operating system, I download and install the Linux version of redis. Since the first installation of redis is based on the tutorial, each step is operated step by step according to the tutorial. Finally, the installation is successful, and the command execution is also very smooth. Although the execution is complete, I don’t know much about the operation. There was a problem when installing redis today. The screenshot is as follows:

I’m talking about my installation steps:

Step 1: create a new directory and enter it

[[email protected] ~]# mkdir -p software/download/redis

               [[email protected] ~]# cd software/download/redis

               [[email protected] redis]#

Step 2: in the current directory, execute WGet command to start downloading redis package

             [[email protected] redis]# pwd
             /root/software/download/redis

             [[email protected] redis]# wget http://redis.io/download/redis-4.0.tar.gz
             //.....
             //start to download
             //...
             //download finish

Step 3: decompress the redis file in the current directory

             [[email protected] redis]# pwd
             /root/software/download/redis

             [[email protected] redis]# tar zxvf redis-4.0.6.tar.gz
             OK

             [[email protected] redis]# ls
             redis-4.0.6   redis-4.0.6.tar.gz

Step 4: enter the redis root directory, execute the make command, and start compiling

[[email protected] redis]# cd redis-4.0.6
             [[email protected] redis-4.0.6]# make
             //Start compiling
             //....
             //Complete compilation

Step 5: copy the relevant files to the specified directory with the directory address of/root/application/program/redis to complete the operation

             [[email protected] redis]# pwd
             /root/software/download/redis

             [[email protected] redis]# cp redis.conf /root/application/program/redis/
             [[email protected] redis]# cd src

             [[email protected] src]# cp redis-cli /root/application/program/redis/
             OK

             [[email protected] src]# cp redis-server /root/application/program/redis/
             OK

             [[email protected] src]# cp redis-benchmark /root/application/program/redis/
             OK

after the above five steps are completed, and the redis.conf configuration file has been modified, I think redis server can be started. When I execute the following command, I will prompt an error

[[email protected]~]# cd application/program/redis

          [[email protected] redis]# redis-server redis.conf
          -bash:redis-server:command not found

          //It is also the screenshot above

After debugging, I found that I had omitted the sixth step. I thought the make command could be executed and compiled. There was no need to execute the make install command. I thought that the function of the make install command was to copy the redis related files to the/usr/local/bin directory. It turned out that if it was not executed, the redis server redis.conf command would not be executed

The following is the sixth step. After this process, we will have a deeper understanding

Step 6: go back to the/root/software/download/redis/redis-4.0.6/src directory and execute the make install command to complete all the installation

[[email protected]~]# cd software/download/redis/resis-4.0.6/src
          [[email protected] src]# make install
          //Start installation
          //...
          //Installation complete

Well, the problem has been solved. I find a truth that “failure is the mother of success”. Through continuous operation and debugging, the understanding will be different, especially for software development. Start to test the cluster mode of master-slave replication of two Linux versions of redis

Similar Posts: