Centos下设置Redis开机重启
简介Centos下设置Redis开机重启
1、首先复制配置文件redis.conf(在安装目录下)到/etc/redis/下(如果/etc下没有redis目录,先创建)
[root@localhost utils]# mkdir -p /etc/redis
[root@localhost utils]# cp /apps/redis/redis.conf /etc/redis/6379.conf #这里为什么是6379,这里主要是取决于启动脚本
[root@localhost utils]# ll /etc/redis/
total 60
-rw-r--r-- 1 root root 58766 Jun 6 16:28 6379.conf
2、设置/etc/redis/6379.conf中daemonize为yes,确保守护进程开启,也就是在后台可以运行
daemonize yes
3、复制redis启动脚本(在安装目录下/apps/redis/utils/redis_init_script)文件到/etc/init.d下
[root@localhost utils]# cp /apps/redis/utils/redis_init_script /etc/init.d/redis
4、修改启动脚本
#1、在/etc/init.d/redis文件的头部添加下面两行注释代码,也就是在文件中#!/bin/sh的下方添加
# chkconfig: 2345 10 90
# description: Start and Stop redis
#2、修改EXEC和CLIEXEC路径为自己安装的路径
EXEC=/apps/redis/src/redis-server
CLIEXEC=/apps/redis/src/redis-cli
这里说明下,上面的配置文件为什么是6379.conf,主要在于启动脚本的这行代码:CONF=”/etc/redis/${REDISPORT}.conf”,所以为了简便起见使用了6379.conf,也可以根据个人习惯修改.
5、启动和停止
打开redis命令:service redis start
关闭redis命令:service redis stop
[root@localhost utils]# service redis start
Starting Redis server...
6820:C 06 Jun 16:34:51.045 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
6820:C 06 Jun 16:34:51.045 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=6820, just started
6820:C 06 Jun 16:34:51.045 # Configuration loaded
[root@localhost utils]# ps -axu|grep redis
root 5095 0.0 0.1 16272 1424 pts/1 S+ 16:03 0:00 src/redis-cli
root 6821 0.0 0.2 41676 2212 ? Ssl 16:34 0:00 /apps/redis/src/redis-server 127.0.0.1:6379
root 6826 0.0 0.0 112660 968 pts/0 R+ 16:34 0:00 grep --color=auto redis
[root@localhost utils]#
[root@localhost utils]#
[root@localhost utils]# service redis stop
Stopping ...
Redis stopped
[root@localhost utils]# ps -axu|grep redis
root 5095 0.0 0.1 16272 1424 pts/1 S+ 16:03 0:00 src/redis-cli
root 6839 0.0 0.0 112660 964 pts/0 R+ 16:35 0:00 grep --color=auto redis
6、设置为开机启动命令
设为开机启动:chkconfig redis on
设为开机关闭:chkconfig redis off
Electron页面跳转、浏览器打开链接和打开新窗口
分割线是也是比较常用的组件,本文主要介绍下Divider和VerticalDiVider的使用方法。
《康熙王朝》是一部非常优秀的电视连续剧,陈道明演的康熙是我觉得最有帝王气魄,让人意犹未尽,本文主要记录一小段非常经典的对白。
Python调用WPS把文档转换PDF,并把PDF转图片,首先需要安装WPS,然后利用pypiwin32把文档转化成PDF,再利用fitz、PyMuPD把PDF转化成图片
快速生成表格
在使用Git的过程中,不想每次都输入用户名和密码去拉取代码,所以就需要保存这些信息,那么既然有保存了,就必须有清除功能。
Docker编译镜像出现:fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.12/main: temporary error (try again later)
WARNING: Ignoring APKINDEX.2c4ac24e.tar.gz: No such file or directory问题
在Mac电脑中,如何对Git的用户名和密码进行修改呢?起初不懂Mac,所以整了很久,本文将记录如何对这个进行操作,以便后期使用。