1. 程式人生 > 其它 >Redis學習--過期鍵清理策略

Redis學習--過期鍵清理策略

  

管理指令碼

啟動指令碼

#!/bin/bash

sadistic=/usr/local/kafka

cat /root/nodes | while read line
do
{
    echo zookeeper $line starting ...
    ssh $line "nohup $sadistic/bin/zookeeper-server-start.sh $sadistic/config/zookeeper.properties >/dev/null 2>&1 &" </dev/null
}
done

wait

cat /root/nodes | while
read line do { echo kafka $line starting ... ssh -f $line "nohup $sadistic/bin/kafka-server-start.sh $sadistic/config/server.properties >/dev/null 2>&1" } done wait

終止指令碼

#!/bin/bash

sadistic=/usr/local/kafka

while read line
do
{
	echo kafka $line stopping ...
	ssh -n $line "$sadistic/bin/kafka-server-stop.sh"
} &
wait
done < /root/nodes


while read line
do
{
	echo zookeeper $line stopping ...
	ssh -n $line "$sadistic/bin/zookeeper-server-stop.sh"
} &
wait
done < /root/nodes

wait

  

Configurtion