Set up redis single-host edition & amp; java interface call in 10 minutes and set up redis single-host Edition

Source: Internet
Author: User

Set up redis single-host edition & java interface call in 10 minutes and set up redis single-host Edition

The redis-3.0.0.tar.gz package is built on the redisserver in this single-host version. It mainly records the installation experience and does not like it!

1. Set up the redis server standalone Edition

1. Upload redis-3.0.0.tar.gzto the server, and upload redis-3.0.0.tar.gz to the RZ command.

If the rz command is unavailable, run yum install lrzsz.

 

2. A successful upload is displayed.

3. Create a folder to store the decompressed redis.

4、decompress redis-3.0.0.tar.gz to the specified folder/redis Execute Command tar-zxvf redis-3.0.0.tar.gz-C/redis/

5. Go to the decompressed redis directory for compilation

6. Location of the compiled file.

7. Create a 6379 directory under the redis extract directory for installing redis.

 

8. install redis and run the command make PREFIX =/redis/6379 install.

9. Copy the redis configuration file to the 6379 (redis installation directory) directory. In this step, the redis single-host version is basically installed.

 

10. The default startup mode of redis is foreground startup. This time we modify the configuration file for background startup, modify the configuration file, and change daemonize

If yes, it indicates that the background is started.

11. Start redis (this method must be enabled later). The redis inventory is placed in the 6379 directory. If you enter the bin directory, start redis.

Then, the redis database will be in the bin directory.

12. Connect to redis.

13. Check the redis key value. Now the redis single-host server has been set up successfully.

Ii. java interface calls redis

1. Configure the redis connection in spring.

2. Create a test class and call redis using the jedis java interface.

3. Now, the redis standalone version has been successfully built and called using the java interface jedis.

 

Related Article

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.