加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

如何找到linux centos7 中 redis.conf

发布时间:2020-12-13 23:41:38 所属栏目:Linux 来源:网络整理
导读:我们假设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) D

  我们假设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

.. ... (后续内容省略)

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

?

?

?

?

错误的示范

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

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

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读