下面由宝塔面板教程栏目给大家介绍服务器宝塔面板redis无法随系统启动的解决办法,希望对需要的朋友有所帮助!
解决服务器宝塔面板redis无法随系统启动
解决服务器debian 9宝塔面版自带redis重启后无法随系统自动启动。
补充安装宝塔面板的redis安装路径在/www/server/redis在redis安装目录下src文件夹里的两个文件redis-server、redis-cli分别是redis的服务器和客户端。需要进入src目录,执行make install,这两个文件会被拷贝到/usr/local/bin目录,/usr/local/bin定义在系统的环境变量$path下,这样终端在任何路径都可以执行redis-server和redis-cli了。打开sshcd /www/server/redis/srcmake install
打开/www/server/redis/utils/redis_init_script#!/bin/sh## simple redis init.d script conceived to work on linux systems# as it does use of the /proc filesystem.### begin init info# provides: redis_6379# default-start: 2 3 4 5# default-stop: 0 1 6# short-description: redis data structure server# description: redis data structure server. see https://redis.io### end init inforedisport=6379exec=/usr/local/bin/redis-servercliexec=/usr/local/bin/redis-clipidfile=/var/run/redis_${redisport}.pidconf=/etc/redis/${redisport}.confcase $1 in start) if [ -f $pidfile ] then echo $pidfile exists, process is already running or crashed else echo starting redis server... $exec $conf fi ;; stop) if [ ! -f $pidfile ] then echo $pidfile does not exist, process is not running else pid=$(cat $pidfile) echo stopping ... $cliexec -p $redisport shutdown while [ -x /proc/${pid} ] do echo waiting for redis to shutdown ... sleep 1 done echo redis stopped fi ;; *) echo please use start or stop as first argument ;;esac
conf设定的路径是/etc/redis/,把redis安装目录下的redis.conf文件拷贝到/etc/redis/6379.conf在面板重启redis以上就是服务器宝塔面板redis无法随系统启动怎么办呢的详细内容。