redis 安裝啟動

2021-08-10 13:33:05 字數 2285 閱讀 4200

@(redis)[安裝,啟動]

注意事項

wget 

.io/releases/redis-4.0

.2.tar

.gz

tar xf redis-4.0

.2.tar

.gzcd redis-4.0

.2

vim redis.conf
nohup src/redis-server redis.conf &
./redis-cli

-h192.168

.15.38

-p6379

mv redis-4.0

.2 /usr/local/redis

cd /usr/local/redis

cp redis.conf

6379.conf

cp utils/redis_init_script /etc/init.d/redis
編輯開機自啟指令碼

vim /etc/init.s/redis
開機自啟指令碼內容

#!/bin/sh

## ****** redis init.d script conceived to work on linux systems

# as it does use of the /proc filesystem.

# chkconfig: 2345 10 90

# description: start and stop redis

# source function library.

. /etc/rc.d/init.d/functions

redisport=6379

exec=/usr/local/redis/src/redis-server

cliexec=/usr/local/redis/src/redis-cli

pidfile=/var/run/redis_$.pid

conf="/usr/local/redis/$.conf"

case

"$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 -h 192.168.15.38 -p $redisport shutdown

while [ -x /proc/$ ]

doecho

"waiting for redis to shutdown ..."

sleep 1

done

echo

"redis stopped"

fi ;;

*)echo

"please use start or stop as first argument"

;;esac

chmod +x /etc/init.d/redis

chkconfig --add redis `新增服務`

chkconfig --list redis `檢視伺服器啟動狀態`

chkconfig redis on `設定服務開機啟動`

redis的配置檔案必須有可執行許可權

service redis does not support chkconfig的解決辦法,需要新增# chkconfig: 2345 10 90. /etc/rc.d/init.d/functions載入系統的函式

redis 安裝 啟動

redis官網 tar xzf redis 2.8.9.tar.gz cd redis 2.8.9 make 檔案說明 redis server redis伺服器的daemon啟動程式 redis cli redis命令列操作工具。redis benchmark redis效能測試工具,測試redi...

redis安裝與啟動

安裝步驟 第一步 安裝gcc編譯環境 如果系統不是最小化安裝正常都不必重新安裝 yum install gcc c 第二步 把redis的原始碼上傳到linux伺服器。第三步 解壓縮。第四步 進入到解壓目錄,使用make命令進行編譯 第五步 make install prefix usr local...

安裝並啟動redis

1.首先執行解壓指令 tar zxvf redis 3.0.7.tar.gz 2.cd指令切到解壓目錄中,然後執行指令 make 執行make的時候,會出現異常 異常一 make 2 cc command not found 異常原因 沒有安裝gcc 解決方案 yum install gcc 異常二...