Linux   发布时间:2022-03-31  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了如何找到linux centos7 中 redis.conf大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

  我们假设redis正在运行,但是我们找不带redis的配置文件redis.conf. 正确的示范: (1)systemctl status redisredis.service - LSB: starts redis Loaded: loaded (/etc/rc.d/init.d/redis; bad; vendor preset: disabled) Active: inactive

  我们假设redis正在运行,但是我们找不带redis配置文件redis.conf.

正确的示范:

(1)systemctl status redis

redis.service - LSB: starts redis
Loaded: loaded (/etc/rc.d/init.d/redis; bad; vendor preset: disabled)
Active: inactive (dead)
Docs: man:systemd-sysv-generator(8)

  由此处可见,redis/etc/rc.d/init.d/redis

 

 

 

(2)cat /etc/rc.d/init.d/redis

#!/bin/sh
# chkconfig: 2345 56 26
# description: redis service

### BEGIN INIT INFO
# Provides: redis
# required-Start: $all
# required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts redis
# Description: starts the BT-Web
### END INIT INFO

# Simple redis init.d script conceived to work on Linux systems
# as it does use of the /proc filesystem.

CONF="/www/server/redis/redis.conf"
redisPORT=$(cat $CONF |grep port|grep -v ‘#‘|awk ‘{print $2}‘)
redisPASS=$(cat $CONF |grep requirepass|grep -v ‘#‘|awk ‘{print $2}‘)
if [ "$redisPASS" != "" ];then
redisPASS=" -a $redisPASS"
fi
if [ -f /www/server/redis/start.pl ];then
STARPORT=$(cat /www/server/redis/start.pl)
else
STARPORT=6379
fi
EXEC=/www/server/redis/src/redis-server
CLIEXEC="/www/server/redis/src/redis-cli -p $STARPORT$redisPASS"
PIDFILE=/var/run/redis_6379.pid

.. ... (后续@L_616_8@省略)

  由此可见 redis.conf 在这儿 CONF="/www/server/redis/redis.conf"

 

 

 

 

错误的示范

(1)find / redis.conf  (找不到)

(2)find / 6379.conf (某位网友的建议,然而没卵用)

(3)rpm -ql redis (也不行)

大佬总结

以上是大佬教程为你收集整理的如何找到linux centos7 中 redis.conf全部内容,希望文章能够帮你解决如何找到linux centos7 中 redis.conf所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。