- Install TCL environment:
Wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz tar - XZVF tcl8.6.1 - SRC. Tar. Gzcd /usr/local/tcl8.6.1/ Unix /./configure make && make installCopy the code
- Redis installation:
Wget http://download.redis.io/releases/redis-5.0.5.tar.gz tar - ZXVF redis - 5.0.5. Tar. GzcdRedis - 5.0.5 make && maketest && make install Copy the code
- Redis configuration:
- Copy the redis_init_script script from the redis utils directory to the /etc/init.d directory on Linux and rename it redis_6379
- (If you need to change the startup port of Redis, modify REDISPORT in line 6 of the redis_6379 script (default: 6379).)
- Conf file in the redis directory to /etc/redis/6379.conf
- Create a directory for storing redis data (persistent files) : /var/redis/6379
- Adjust the following configuration of redis.conf:
- Daemonize yes # Let Redis run as a daemon
- Pidfile /var/run/redis_6379.pid # set redis pidfile location
- (port 6379) # set the redis listening port number
- Dir /var/redis/6379 # Set the location of the persistence file
- Bind 192.168.xx.xx # Bind the local IP address
- Set up Redis startup:
- At the top of the redis_6379 script, add two lines of comment
# chkconfig: 2345 90 10 # description: Redis is a persistent key-value database Copy the code
- Execute command:
chkconfig redis_6379 on Copy the code
- At the top of the redis_6379 script, add two lines of comment
- The correct way to open (and close) Redis:
/etc/init.d redis_6379 start # Open method 2 redis-server /redis.conf Kill -9: delete pid file manuallyRedis -cli -h 192.168.xx.xx -p 6379 shutdownCopy the code
First published on my blog: Zephyrlai.github. IO