Centos7設定redis開機啟動

2021-09-26 05:18:33 字數 806 閱讀 4773

1.vi /lib/systemd/system/redis.service

[unit]

description=redis

after=network.target

[service]

type=forking

pidfile=/var/run/redis_6379.pid

execstart=/usr/local/bin/redis-server /etc/redis/redis.conf (這裡注意下)

execreload=/bin/kill -s hup $mainpid

execstop=/bin/kill -s quit $mainpid

privatetmp=true

[install]

wantedby=multi-user.target

2.重新整理配置

剛剛配置的服務需要讓systemctl能識別,就必須重新整理配置

systemctl daemon-reload

3.啟動、重啟、停止

啟動redis

systemctl start redis

systemctl restart redis

systemctl stop redis

4.開機自啟動

redis服務加入開機啟動

systemctl enable redis

禁止開機啟動

systemctl disable redis

Centos7設定keepAlived開機自啟動

1.安裝依賴包 openssl yum install openssl 2.安裝依賴包openssl devel yum y install openssl devel 3.安裝keepalived a.將安裝包keepalived 2.0.18.tar.gz上傳到 usr local目錄 b.依次...

CentOS7下Redis的安裝和設定開機啟動

以下命令預設都是在root許可權下執行 wget tar xvzf redis 5.0.2.tar.gz cd redis 5.0.2 make 編譯 make install redis cli redis server等執行檔案會拷貝到 usr local bin 成功安裝完成後可以在任意目錄執...

Centos7安裝Redis 設定Redis啟動

wgettar zxvf redis 5.0.4.tar.gzyum install gcccd redis 5.0.4make malloc libcmv redis 5.0.4 usr local 選擇資料夾執行 cd src make install安裝完成!執行完make命令後,進入src ...