Original address: http://blog.sina.com.cn/s/blog_505bf9af0101ehhp.html
Redis installation, configuration
The installation steps are as follows:
To download the Redis installation package:
$ cd/opt/app (can choose the installation directory according to the actual situation)
$ wget wget http://redis.googlecode.com/files/redis-2.6.14.tar.gz
$ tar zxvf redis-2.6.14.tar.gz
$ CD redis-2.6.14
Just make it right.
$ make
When you are done, execute
$ make Test
If the following error is reported:
CD src && make test
MAKE[1]: Entering directory '/OPT/APP/REDIS-2.6.14/SRC '
You need TCL 8.5 or newer in order to run the Redis test
MAKE[1]: * * * [Test] Error 1
MAKE[1]: Leaving directory '/OPT/APP/REDIS-2.6.14/SRC '
Make: * * * [Test] Error 2
When you meet the above error, please execute ' yum install Tcl '
Indicates the need to install TCL
Perform
$ sudo yum install Tcl
to this Redis installation is complete.
Let's try booting up and see if the appropriate port is already started:
Start Redis
$ src/redis-server./redis.conf
and see if the appropriate port is already started
$ NETSTAT-TLNP
TCP 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 6432/redis-server
At this point, all the configurations are the default port is 6379 and you can see that Redis is running in the foreground.
Configure Redis to run in the background
Here to modify the Redis configuration file, mainly redis.conf this file.
Open the file redis.conf, modify "Daemonize no" to "daemonize yes", and then restart the next Redis:
Src/redis-server./redis.conf
You can see that Redis is running in the background.
to start the configuration of multiple Redis instances
Copy redis.conf to redis-test.conf (example)
Modify the Redis-test.conf file
"Daemonize No" is "daemonize yes", "Port 6379" is "Port 6380" and the next Redis is started:
Src/redis-server./redis-test.conf
To see if it starts:
$ NETSTAT-TLNP
You should be able to see the following process:
TCP 0 0 0.0.0.0:6380 0.0.0.0:* LISTEN ***2/redis-server
In addition: You can pass the Telnet IP port, if telent, the Redis successfully started.
Reference article: http://zhou123.blog.51cto.com/4355617/1196415
Additional references to Redis multiple instances:
Redis installation, configuration--Reprint