Install and start redis in Ubuntu

Source: Internet
Author: User
Tags dotfiles

1. Download and install

 
CD/TMPWgetHTTP://Redis.googlecode.com/files/redis-2.2.13.tar.gzTar-Zxf redis-2.2.13.Tar. Gzcd redis-2.2.13MakeSudo Make Install

In this case, the redis executable file is stored in/usr/local/bin.

2. Download the configuration file and the init STARTUP script:

WgetHttps://Github.com/ijonas/dotfiles/raw/master/etc/init.d/redis-serverWgetHttps://Github.com/ijonas/dotfiles/raw/master/etc/redis.confSudo MVRedis-server/etc/init. d/redis-ServerSudo Chmod+ X/etc/init. d/redis-ServerSudo MVRedis. CONF/etc/redis. conf

 

3. initialize the user and Log Path
Before starting redis for the first time, we recommend that you create a separate user for redis and create a new data and log folder.

SudoUseradd redisSudo Mkdir-P/var/lib/RedisSudo Mkdir-P/var/log/RedisSudo ChownRedis. redis/var/lib/RedisSudo ChownRedis. redis/var/log/redis

4. Set Automatic startup and automatic shutdown

 
SudoUpdate-rc.d redis-server ults

5. Start redis:

 
Sudo/Etc/init. d/redis-Server start

6. Start the client connection:

$ Redis-Cliredis>Set Foo barokredis>Get foo"Bar"

 

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.