Tag Archives: redis-servercommand not found

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

[root@linux ~]# mkdir -p software/download/redis

               [root@linux ~]# cd software/download/redis

               [root@linux redis]#

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

             [root@linux redis]# pwd
             /root/software/download/redis

             [root@linux 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

             [root@linux redis]# pwd
             /root/software/download/redis

             [root@linux redis]# tar zxvf redis-4.0.6.tar.gz
             OK

             [root@linux 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

[root@linux redis]# cd redis-4.0.6
             [root@linux 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

             [root@linux redis]# pwd
             /root/software/download/redis

             [root@linux redis]# cp redis.conf /root/application/program/redis/
             [root@linux redis]# cd src

             [root@linux src]# cp redis-cli /root/application/program/redis/
             OK

             [root@linux src]# cp redis-server /root/application/program/redis/
             OK

             [root@linux 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

[root@linux~]# cd application/program/redis

          [root@linux 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

[root@linux~]# cd software/download/redis/resis-4.0.6/src
          [root@linux 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