Installing Redis under Windows and Linux

Source: Internet
Author: User
Tags install redis redis server

1. Introduction to Redis
Redis 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 HASHS (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 (stored in-memory) 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 the python,ruby,erlang,php client, which is very convenient to use.

2. Installing Redis under Windows
Https://github.com/dmajkic/redis/downloads. The Redis that you downloaded supports 32bit and 64bit (or you can download EXE files, the path is https://github.com/rgl/redis/downloads). According to their actual situation choice, I choose 64bit. Go directly to the 64-bit directory, my directory is: E:\dev\redis-2.4.5-win32-win64\64bit

Open a CMD window to switch to 64 for the directory where the files run: redis-server.exe redis.conf . The following interface appears:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/57/AD/wKiom1SiEbHQw7SrAAFnKMDoqK8470.jpg "title=" 1.png " alt= "Wkiom1siebhqw7sraafnkmdoqk8470.jpg"/>

This means that the Redis server has been successfully installed.

Open a CMD window to switch to 64 for the directory where the files run  redis-cli.exe-h 127.0.0.1-p 6379 where 127.0.0.1 is the local ip,6379 is the default port on the Redis server. The run succeeds as shown in.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/57/AD/wKiom1SiEkfxAA6qAACop0g2W3E221.jpg "title=" 2.png " alt= "Wkiom1siekfxaa6qaacop0g2w3e221.jpg"/>

Here's a little test:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/57/AB/wKioL1SiE3biQfIHAADoXzjr2mM593.jpg "title=" 3.png " alt= "Wkiol1sie3biqfihaadoxzjr2mm593.jpg"/>

If it can be displayed properly, the instructions are OK and can be used normally.


Installing Redis on Linux Ubuntu

I am using Ubuntu 14.04 LTS, the installation of Redis can be installed through the Apt-get command, the complete command is as follows:

sudo apt-get install Redis-server

After installation, the database can be started automatically, first check the process of Redis:

Ps-aux|grep Redisredis 4162 0.1 0.0 10676 1420? Ss 23:24 0:00/usr/bin/redis-server/etc/redis/redis.confconan 4172 0.0 0.0 11064 924 pts/0 s+ 23:26 0 : + grep--color=auto Redis

Then check the status below to see if it starts:

Netstat-nlt|grep 6379tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN

Installing the server will automatically install a command-line tool REDIS-CLI, run redis-cli in any directory to start the service, please test yourself.


Redis configuration:

(1) Login password

By default, access to the Redis server does not require a password, and for added security we need to set the access password for the Redis server.

Open the configuration file for Redis server with VI redis.conf

sudo vi/etc/redis/redis.conf# uncomment requirepassrequirepass redistest//redistest for password re-login redis-cli-a redistest, If you are not logged in with a password, you can log on successfully but the prompt does not have permission

(2) Support remote

by default, the Redis server does not allow remote access and allows only native access.

sudo vi/etc/redis/redis.conf# comment bind#bind 127.0.0.1

Basic configuration is here, welcome to leave a message!

This article is from the "Eason's HCC" blog, so be sure to keep this source http://hcc0926.blog.51cto.com/172833/1597641

Installing Redis under Windows and Linux

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.