Install redis on Ubuntu 12.04

Source: Internet
Author: User
Tags dotfiles install redis

Redis is an open-source and free-of-charge storage database based on memory and key-value pairs. Compared with memcached, redis only supports simple values. redis supports a wide range of value sets, it includes strings, lists, sets, and hashes.

 

$ Wget http://download.redis.io/releases/redis-2.8.3.tar.gz
$ Tar xzf redis-2.8.3.tar.gz
$ Redis-2.8.3 CD
$ Make
$ Sudo make install # The redis executable file is stored in/usr/local/bin.

 

Start the service:

$ Src/redis-Server

Open the client:

$ Src/redis-cli
Redis> set Foo bar
OK
Redis> Get foo
"Bar"

 

========================================================== ======================================

 

1. Download and install?
cd /tmpwget http://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 :?
wget https://github.com/ijonas/dotfiles/raw/master/etc/init.d/redis-serverwget https://github.com/ijonas/dotfiles/raw/master/etc/redis.confsudo mv redis-server /etc/init.d/redis-serversudo chmod +x /etc/init.d/redis-serversudo mv redis.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.

?
sudo useradd redissudo mkdir -p /var/lib/redissudo mkdir -p /var/log/redissudo chown redis.redis /var/lib/redissudo chown redis.redis /var/log/redis
4. How can I Enable Automatic startup and disable automatic shutdown?
sudo update-rc.d redis-server defaults
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.