Redis icons are quite interesting.

Source: Internet
Author: User
Tags redis version install redis


Use of redis


1. Install redis official site steps install redis (http://redis.io/download)


$ wget http://download.redis.io/releases/redis-2.8.15.tar.gz$ tar xzf redis-2.8.15.tar.gz$ cd redis-2.8.15$ make


2. Start redis


$ src/redis-server

Or


Start the background


nohup src/redis-server &

Process

[1] 16461


Interesting tips

[email protected]:/srv/rorapps/redis/redis-2.8.15# src/redis-server [16445] 16 Sep 09:54:32.684 # Warning: no config file specified, using the default config. In order to specify a config file use src/redis-server /path/to/redis.conf[16445] 16 Sep 09:54:32.686 * Increased maximum number of open files to 10032 (it was originally set to 1024).                _._                                                             _.-``__ ''-._                                                   _.-``    `.  `_.  ''-._           Redis 2.8.15 (00000000/0) 64 bit  .-`` .-```.  ```\/    _.,_ ''-._                                    (    '      ,       .-`  | `,    )     Running in stand alone mode |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379 |    `-._   `._    /     _.-'    |     PID: 16445  `-._    `-._  `-./  _.-'    _.-'                                    |`-._`-._    `-.__.-'    _.-'_.-'|                                   |    `-._`-._        _.-'_.-'    |           http://redis.io          `-._    `-._`-.__.-'_.-'    _.-'                                    |`-._`-._    `-.__.-'    _.-'_.-'|                                   |    `-._`-._        _.-'_.-'    |                                    `-._    `-._`-.__.-'_.-'    _.-'                                         `-._    `-.__.-'    _.-'                                                 `-._        _.-'                                                         `-.__.-'                                               [16445] 16 Sep 09:54:32.688 # Server started, Redis version 2.8.15[16445] 16 Sep 09:54:32.688 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.[16445] 16 Sep 09:54:32.688 * The server is now ready to accept connections on port 6379


OK, the above redis server is complete



3. Client usage

This section describes how to use rails.

Gem

Redis-Rb (https://github.com/redis/redis-rb)


require "redis"redis = Redis.newredis.set("mykey", "hello world")# => "OK"redis.get("mykey")# => "hello world"



OK, simple Client Version


4. troubleshoot

Prompt

Redis::ProtocolError ( Got 'H' as initial reply byte. If you're in a forking environment, such as Unicorn, you need to connect to Redis after forking. ):

Your redis service is not started.







Redis icons are quite interesting.

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.