Installation configuration of Redis under Ubuntu environment

Source: Internet
Author: User
Tags dotfiles

Installation configuration of Redis under Ubuntu environment

1. Brief introduction
Dis is a key-value storage system. Similar to memcached, it supports storing more value types, including string (string), list (linked list), set (set), Zset (sorted set-ordered collection), and hash (hash type). These data types support Push/pop, Add/remove, and intersection-set and difference sets, and richer operations, and these operations are atomic. Based on this, Redis supports sorting in a variety of different ways. As with memcached, data is cached in memory to ensure efficiency. The difference is that Redis periodically writes the updated data to disk or writes the modified operation to the appended record file, and Master-slave (Master-Slave) synchronization is implemented on this basis.
Redis is a high-performance Key-value database. The emergence of Redis, to a large extent, compensates for the lack of memcached such key/value storage, in some cases can be a good complement to the relational database. It provides clients such as Java,c/c++,c#,php,javascript,perl,object-c,python,ruby,erlang, which is convenient to use.
Redis supports master-slave synchronization. Data can be synchronized from the primary server to any number of slave servers, from the server to the primary server that is associated with other slave servers. This enables Redis to perform single-layer tree replication. You can write to the data intentionally or unintentionally. Because of the full implementation of the publish/subscribe mechanism, you can subscribe to a channel and receive a complete message release record from the master server when the tree is synchronized anywhere from the database. Synchronization is helpful for the scalability and data redundancy of read operations.

2. Installation

Environment Ubuntu 14.10 redis-2.8.9
wget http://download.redis.io/releases/redis-2.8.9.tar.gz
TAR-ZXVF redis-2.8.9.tar.gz-c.
CD redis-2.8.9.tar.gz
Make && make install (No./configure required)

3. Start the Redis service

/usr/local/bin/redis-server

4. Set up Redis boot up

Vim/etc/rc.local
Join
/usr/local/src/redis-2.8.9/src/redis-server
: Wq

5. Connecting the client

/usr/local/src/redis-2.8.9/src/redis-cli
Show
Redis 127.0.0.1:6379>

6. View the Redis log Session

7. Stop Redis Service
/USR/LOCAL/SRC/REDIS-2.8.9/SRC/REDIS-CLI shutdown

8. Configuration Files

Default Port 6379
Vim redis.conf


9.redis Boot Script Configuration


1. Configure the Init script:

wget Https://github.com/ijonas/dotfiles/raw/master/etc/init.d/redis-server
wget https://github.com/ijonas/dotfiles/raw/master/etc/redis.conf
sudo mv Redis-server/etc/init.d/redis-server
sudo chmod +x/etc/init.d/redis-server
sudo mv redis.conf/etc/redis.conf

2. Initializing user and log paths

Before starting Redis for the first time, it is recommended that you create a separate user for Redis and create a new data and log folder
sudo useradd Redis
sudo mkdir-p/var/lib/redis
sudo mkdir-p/var/log/redis
sudo chown Redis.redis/var/lib/redis
sudo chown Redis.redis/var/log/redis

3, set the boot automatically start, shut down automatically

sudo update-rc.d redis-server defaults

4. Start Redis:

Sudo/etc/init.d/redis-server start

Installation configuration of Redis under Ubuntu environment

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.