欧卡2中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

需要三步,才能开始

只需两步,慢速开始

玩欧卡就用莱仕达V99方向盘欧卡2入门方向盘选莱仕达V9莱仕达折叠便携游戏方向盘支架欢迎地图Mod入驻
查看: 3918|回复: 0
收起左侧

Cloudstack重置停止脚本

[复制链接]
oppo 发表于 2014-9-24 10:43 | 显示全部楼层 |阅读模式
cloudstatus.sh  :cloudstack状态脚本
[tex=code]#!/bin/bash

service mysqld status
if [ $? != 0 ];then
rm -f /var/lib/mysql/mysql.sock
/etc/init.d/mysqld restart
/etc/init.d/cloudstack-management restart
/etc/init.d/cloudstack-agent restart
fi

service cloudstack-management status
service cloudstack-agent status
service nfs status
service rpcbind status
service libvirtd status[/tex]


restartCloud.sh : 重置cloudstack
[tex=code]#!/bin/bash

mount -t  nfs 10.217.55.201:/secondary /mnt/secondary
service mysqld restart
/etc/init.d/rpcidmapd restart
service rpcbind restart
service nfs restart
service libvirtd restart
service cloudstack-agent restart
service cloudstack-management restart

df -h[/tex]


stopCloud.sh : 卸载nfs存储
[tex=code]#!/bin/bash
#set -x
PRIMARY=primary
PASSWD=07d76510c47920ea31c6ad0102bbd73f

function StopCloud()
{
MOUNT=`df | grep $PRIMARY | awk '{print $6}'`

for pid in `fuser -m $MOUNT`
do
  echo $pid | grep -E "^[0-9]+$" &>/dev/null && r=0 || r=1
  [ $r -eq 0 ] && kill -9 $pid
done
}

read -p "kill cloudstack primary storage. please input password:" PWD
PWD=`echo $PWD | md5sum | awk '{print $1}'`
if [ "$PWD"x = "$PASSWD"x ]; then
StopCloud
else
echo "incorrect password"
exit 1
fi[/tex]

联系我们|手机版|欧卡2中国 ( 湘ICP备11020288号-1 )

GMT+8, 2024-11-25 12:36 , Processed in 0.032326 second(s), 7 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表