Download, unzip and compile Redis:
$ wget http://download.redis.io/releases/redis-4.0.11.tar.gz $ tar xzf redis-4.0.11.tar.gz $ cd redis-4.0.11 $ make
If you want to download the gcc compiler during this period, follow the prompts to download the corresponding software.
The now compiled binary (redis related commands) is located in the src directory. Run Redis:
, you will find that the startup is successful, but did not exit the current operation, you need to press ctrl+c to exit, but after ctrl+c, check the redis process (ps -ef|grep redis) and just started The redis process has also been turned off. This is because Redis is the default foreground startup. You need to modify the redis.conf parameters so that redis is started in the background. Reids.conf in the upper directory of src, use the command ../src to open redis.conf, use the command vi redis.conf, set daemonize to yes, press esc to exit the modification state, then: wq save.
Then restart, you need to specify the modified file
[[email protected] src]# ./redis-server redis-conf 32442:C 17 Sep 10:05:18.601 # Fatal error, can't open config file 'redis-conf'
to find the error, this problem only needs to put the redis-conf file into the src directory, and then restart, you can use
The built-in client interacts with Redis:
[[email protected] src]# ./redis-cli 127.0.0.1:6379> set cb nb OK 127.0.0.1:6379> get cb "nb" 127.0.0.1:6379>