The best Redis installation Tutorial In 2024, In this tutorial you can learn Window installed,Linux installed,Ubuntu installed,
Download: https://github.com/MSOpenTech/redis/releases .
Download Redis to support 32bit and 64bit. Selected according to their actual situation, the contents of cp 64bit custom letter to the installation directory name redis. Such as C: \ reids
Open a cmd window using the cd command to change the directory to C: \ redis run redis-server.exe redis.conf.
If you want convenience, you can put the path redis added to the system environment variable, so you lose save path, and behind that redis.conf may be omitted, if omitted, the default is enabled. After the input, the screen will display the following:
This time another start a cmd window, do not close the original, otherwise you can not access the server.
Switch to run under redis redis-cli.exe directory -h 127.0.0.1 -p 6379.
Set the key to set myKey abc
Remove the key to get myKey
Download: http://redis.io/download , download the latest version of the document.
The latest version of the document used in this tutorial is 2.8.17, download and install:
$ wget http://download.redis.io/releases/redis-2.8.17.tar.gz $ tar xzf redis-2.8.17.tar.gz $ cd redis-2.8.17 $ make
make after redis-2.8.17 will appear in the directory service program compiled redis redis-server, as well as for testing client redis-cli, two programs located in the installation directory under the src directory:
The following start redis service.
$ cd src $ ./redis-server
Note that in this way start redis are using the default configuration. You can also tell by redis startup parameters using a specified configuration file using the following command to start.
$ cd src $ ./redis-server redis.conf
redis.conf is a default configuration file. We needed to use their own configuration files.
After starting redis service process, you can use the test client program redis-cli redis interaction and the service. such as:
$ cd src $ ./redis-cli redis> set foo bar OK redis> get foo "bar"
Redi installed in Ubuntu system can use the following command:
$sudo apt-get update $sudo apt-get install redis-server
$ redis-server
$ redis-cli
The above command will open the following terminals:
redis 127.0.0.1:6379>
127.0.0.1 is the local IP, 6379 is redis service port. Now we enter the PING command.
redis 127.0.0.1:6379> ping PONG
Above that we have successfully installed the redis.