下面由Redis教學欄位介紹給大家介紹使用Redis實作排行榜功能的方法,希望對需要的朋友有幫助!
1、拷貝redis 安裝目前下的/usr/local/redis-4.0.8/utils/redis_init_script 到/etc/init.d /redis檔案中;
cp /usr/local/redis-4.0.8/utils/redis_init_script /etc/init.d/redis
登入後複製
2、修改/etc/init.d/redis 檔案。修改redis安裝的相關檔案安裝目錄
#!/bin/sh # chkconfig: 2345 10 90 # description: Start and Stop redis # Simple Redis init.d script conceived to work on Linux systems # as it does use of the /proc filesystem. REDISPORT=6379 EXEC=/usr/local/redis/bin/redis-server CLIEXEC=/usr/local/redis/bin/redis-cli PIDFILE=/var/run/redis_${REDISPORT}.pid CONF="/usr/local/redis/etc/redis.conf"
登入後複製
#
#!/bin/sh # chkconfig: 2345 10 90 # description: Start and Stop redis
登入後複製
##已備註: