Centos6.5 install and configure redis3.0

Source: Internet
Author: User

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.

  1. 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
  1. Rm-fredis-3.0.0-rc2.tar.gz

4. Rename the decompressed folder for ease of use
[Plain] view plaincopy
  1. 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
  1. 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
  1. 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.
  1. 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
  1. 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
  1. 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
  1. 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.
  1. 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
  1. 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.