Centos6.5 install and configure redis3.0
: Https://redis.io/downloadhere, my installation environment is centos6.5, and the Environment is uploaded to the/usr/local directory of linux by supervisor.
2. Run the [plain] view plaincopy command.
- Tar-zxvfredis-3.0.0-rc2.tar.gz
Extract
You can see
3rd Delete redis-3.0.0-rc2.tar.gz using the rm command
[Plain] view plaincopy
- Rm-fredis-3.0.0-rc2.tar.gz
4. Rename the decompressed folder for ease of use
[Plain] view plaincopy
- Mvredis-3.0.0-rc2/redis-3.0.0
5, then compile (the premise is that your linux must install gcc) into the redis-3.0.0 input command
[Plain] view plaincopy
- Make
The compilation process takes a little time. The following content indicates that the compilation is complete.
6. Enter the src directory and enter [plain] view plaincopy
- Makeinstall
Install
We can see that there are many files under this directory, the red box part is redis server and client back to the redis-3.0.0 directory, ls can see a redis. conf file this file is related to the redis configuration file so far it is considered that redis has been installed and then start redis: You can specify the configuration file at startup here redis. the conf Startup File is the redis-server in the src directory. Therefore, you can run the following command to start [plain] view plaincopy.
- Src/redis-server/usr/local/redis-3.0.0/redis. conf
Of course, if you directly enter redis-server, you can also start redis with a set of default configurations.
After the centos is started, you will find that the entire centos is in the redis enabled status and the interface does not do anything else. You can configure it to start it in the background, and we can continue to operate other commands on centos. Enter ctrl + c to exit redis and enter ls to check that there are multiple dump instances in the redis directory. the rdb file is a redis data file, and its storage location can also be in redis. configure [plain] view plaincopy in conf
- Vimredis. conf
(Copy redis is recommended here. conf to your directory, and then change the file upon startup.) enter the editing status, find daemonize no, change it to daemonize yes, and then start it in the background.
You can find dir. /This line of configuration specifies the location where the rdb file is stored. You can modify other configurations, such as the port and database number, as needed. You can also configure the configuration in this file and enter the following again: [plain] view plaincopy
- Src/redis-server/usr/local/redis-3.0.0/redis. conf
Src/redis-server can be omitted and only input redis-server. In this test, the configuration file under the installation directory must be specified. Otherwise, the configuration file is not started in the background as configured in the configuration file.
Enter [plain] view plaincopy
- Ps-ef | gerp6379
You can view the port information.
Port 6379 in the red box indicates that redis is already running in the background. If you want to operate redis, you can run the following command on the client: [plain] view plaincopy.
- Src/redis-cli
You can perform normal operations. redis is stored in the key-value format. Therefore, you can perform the following simple test: The name is key Howard and the value is to exit, you can enter quit or ctrl + c
If you want to disable the background redis service, enter the following command: [plain] view plaincopy
- Src/redis-clishutdown
(Note that my current directory is redis-3.0.0, so only enter src/, if you want to enter the complete in other directories, of course, you can directly enter redis-cli shutdown)
Check the port again and find that the previous 6379 has disappeared.