Small Ant learns Redis notes (2)--redis installation and configuration

Source: Internet
Author: User

Installation of Redis

Http://redis.io/download

Select an up-to-date stable version, currently redis-3.0.5.tar.gz (select stable, stable version)

Unzip the Tarball TAR-ZXVF redis-3.0.5.tar.gz

Enter the directory CD redis-3.0.5

Compile make note here, if an error occurs, remember that the last sentence has an error 2, using the command made MALLOC=LIBC can be.

Install the CD src && make install into the SRC directory and install it. && logic and, command 1 execute correctly, command 2 to execute (Learn Linux first, sure is a lot of benefits ah, Hiehie ... )


For ease of management, you need to make some changes to the file

Recursive creation of two directories

1. Mkdir-p/usr/local/redis/bin This directory holds commands

2. Mkdir-p/usr/local/redis/etc This directory holds the configuration file

Transfer the commands and configuration files to the two directories that you just created

1. mv/lamp/redis-3.0.5/redis.conf /usr/local/redis/etc Transfer the configuration file to the past

Enter SRC directory: cd /lamp/redis-3.0.5/src

2. MV mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-dump redis-cli redis-server /usr/local/re Dis/bin

This is possible, the purpose of this is to facilitate management, because the lamp and other software all the commands and configuration files are stored under the/usr/local/, later management will be more relaxed.


Start Redis Service

/usr/local/redis/bin/redis-server

Start up is started up, but feel good awkward, the service does not start the background, the current interface can not be manipulated. And also reported the warning Warming:no Config file ... A configuration file is missing.

CTRL + C exit to specify a configuration file for the Redis service, command:

/usr/local/redis/bin/redis-server/usr/local/redis/etc/redis.conf

Warming is gone, but still the front-run, this time need to modify the redis.conf configuration file, command:

Vim /usr/local/redis/etc/redis.conf Find daemonize no modified to Yes, run in the background instead.

And then the boot is duly completed ~ (~ ̄▽ ̄) ~


Check whether the start is successful

To view the current process, command:

Ps-ef | grep Redis

Root 2330 1 0 04:11? 00:00:05/usr/local/redis/bin/redis-server *:6379 Instructions Redis is running

To view the 6379-Port listening Service, command:

NETSTAT-TUNPL | grep 6379

TCP 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 2330/redis-server *

TCP 0 0::: 6379:::* LISTEN 2330/redis-server *

Indicates that the Redis service is listening.

Default port for Redis: 6379

Default port for MySQL: 3306

Default ports for MongoDB: 27017 and 28017

OK, which means Redis has started successfully.


Quit Redis Service

Pkill Redis-server


Start the client

/usr/local/redis/bin/redis-cli


learn PHP's small ant original blog http://my.oschina.net/woshixiaomayi/blog




Small Ant learns Redis notes (2)--redis installation and configuration

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.