💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
> 此安装方式只适合centos ## 0. 先安装tcl, 否则make test 会出错 ~~~ yum install tcl ~~~ ## 1. 下载安装, 这个没什么好说的 ~~~ wget http://download.redis.io/releases/redis-3.0.1.tar.gz tar xzf redis-3.0.1.tar.gz cd redis-3.0.1 make make test make install ~~~ ## 2. 将redis添加到系统服务 ~~~ vi /etc/rc.d/init.d/redis -- 粘帖一下代码 ########################### #chkconfig: 2345 10 90 #description: Start and Stop redis PATH=/usr/local/bin:/sbin:/usr/bin:/bin REDISPORT=6379 EXEC=/usr/local/bin/redis-server REDIS_CLI=/usr/local/bin/redis-cli PIDFILE=/var/run/redis.pid CONF="/etc/redis.conf" case "$1" in start) if [ -f $PIDFILE ] then echo "$PIDFILE exists, process is already running or crashed" else echo "Starting Redis server..." $EXEC $CONF fi if [ "$?"="0" ] then echo "Redis is running..." fi ;; stop) if [ ! -f $PIDFILE ] then echo "$PIDFILE does not exist, process is not running" else PID=$(cat $PIDFILE) echo "Stopping ..." $REDIS_CLI -p $REDISPORT SHUTDOWN while [ -x ${PIDFILE} ] do echo "Waiting for Redis to shutdown ..." sleep 1 done echo "Redis stopped" fi ;; restart|force-reload) ${0} stop ${0} start ;; *) echo "Usage: /etc/init.d/redis {start|stop|restart|force-reload}" >&2 exit 1 esac ############################## -- 添加可执行权限 chmod +x /etc/init.d/redis -- 启动redis service redis start -- 设置自启动 chkconfig redis on ~~~ ## 3. 配置防火墙 ~~~ vi /etc/sysconfig/iptables -- 添加配置 -A INPUT -m state --state NEW -m tcp -p tcp --dport 6379 -j ACCEPT -- 重启防火墙 service iptables restart ~~~ ## 4. 测试 ~~~ redis-cli set name shuai "shuai" get name "shuai" ~~~