ceph-dash一键安装

start_dash.sh

tar -zxvf ./ceph-dash.tar.gz
cd ceph-dash
perl start.pl 

stop_dash.sh

value=`ps -ef|grep "python ./ceph-dash.py"|awk ‘{print $2}‘|head -1`
echo $value
kill -9 $value
&KillThread();
my $Usee = system("whoami");
if($User != "root")
{
   die "This script must be run in root\n";
}
print "you are root\n";
#切换目录
chdir("Jinja2-2.7.3");

my $command = system("sudo python setup.py install");
if(0 != $command)
{
 die "install Jinja2 failture\n";
}
print "\nJinja2 Install complete\n";
chdir("..");
$command=system("chmod a+x ./*py");
unless(0 == $command)
{
 die "chmod py failture\n";
}
$command=system("./ceph-dash.py &");
print("\n**********************\n");
print("\nceph dash set up successful\n");
print("\n**********************\n");

#杀死进程
sub KillThread
{
 # my $RumCmd = system("ps -ef|grep *dash.py");
  my $RumCmd = `ps -ef|grep dash.py`;
  
  print $RumCmd; 
  
  my @Content = split ‘\n‘,$RumCmd;
  foreach my $value (@Content)
  {
      if($value =~ m/ceph-dash.py/||$value =~ m/ceph_dash.py/)
      {
  my @Array = split ‘\s+‘,$value;
  my $Num = $Array[1];
         print "\nThread ID is $Num\n"; 
  system("kill -9 $Num"); 
         break;
      }
  }
}
时间: 2024-09-15 06:35:27

ceph-dash一键安装的相关文章

Python实现一键安装部署LNMP环境

最近一直在学Python,东西比较多,时间持续的也比较长,为了能够学以致用,想到了原来写过的shell一键安装部署LNMP脚本,既然shell能写,Python也一定能写,就用学到的知识写了下面这个版本,这可能并不是最优版本,等学到更多东西的时候再进行优化升级! 环境介绍: Python 2.6.6 Centos 6.5 nginx 1.10.1 mysql 5.6.34 php 5.3.3 代码如下: #!/bin/env python import os import sys def ent

一键安装ftp服务器

1 概述 工作中,需要搭建ftp服务器来实现资源的共享.本文将通过脚本实现自动化安装ftp服务器,并进行相关配置,同时创建ftp登录账户,以及创建两个文件夹,作为公共的文件夹,为所有用户提供共同的访问路径. 2 概念解释和注意事项 2.1 chroot_list说明 chroot_list_file=/etc/vsftpd/chroot_list 如果设置为 chroot_local_user=YES chroot_list_enable=YES(这行可以没有, 也可以有) chroot_lis

一键安装shell脚本

一.一键安装nginx脚本 #!/bin/bash #################################### #Name:nginx_install.sh #Author:doublelinux #version:1.1 #Date:2017/08/19 #################################### yum -y install pcre pcre-devel yum -y install openssl openssl-devel mkdir -p

Rehat一键安装mysql脚本和备份数据库脚本

Rehat一键安装mysql脚本 ##说明:适用,Rehat 5 6 7 1.运行状态,运行成功输出mysql临时密码 2.代码如下 #!/bin/bash #获取系统信息 sudo cat /etc/issue>myfile aa=sudo grep '5.' myfile bb=sudo grep '6.' myfile cc=sudo grep '7.' myfile echo $aa echo "It is a test" > myfile #获取系统信息 sudo

在空白主机上一键安装kickstart服务,分发centos5.8和mysql5.7.16

#!/bin/bash chkconfig --add sshd  chkconfig sshd on yum -y install vim man wget #需关闭虚拟交换机的DHCP功能 #需要开放网络 #本机网段192.168.2.x IP20 #客户机硬盘大小100GB #借用了同班同学的Mysql一键安装版本 #安装完成后客户机手动确认重启         line194可修改为自动重启 #缺少判断mysql是否成功下载并提示的判断: # 1.本地FTP共享文件夹是否有mysql*.

使用 shell 脚本实现 LANMP 一键安装

使用 shell 脚本来实现 LANMP 系统的一键安装.使用的操作系统是 CentOS 6 ,不区分 32 位和 64 位,要求机器可以连通互联网.支持 LAMP 和 LNMP ,MySQL 支持 5.1 和 5.6 两个版本, php 支持 5.3 和 5.6 两个版本, apache 2.2 ,nginx 1.8. 代码如下: #!/bin/bash echo "It will install lamp or lnmp." sleep 1 # get the archive of

shell编程之【一键安装 lanmp】

脚本说明 本脚本可以实现一键安装 lamp 或者 lnmp,具体要求如下: 1.要求是一台可以上外网的新机器 2.支持 centos6 系统,不区分32位,64位 3.支持 lamp 和 lnmp 4.mysql 支持 5.1 和 5.6 两个版本 5.php 支持 5.4 和 5.6 两个版本 6.支持 apache2.2 7.支持 nginx1.8 脚本实现 [[email protected] ~]# cd /usr/local/sbin/ [[email protected] sbin]

Ubuntu Or Debian L2TP VPN 一键安装脚本

#!/bin/bash if [ $(id -u) != "0" ]; then printf "Error: You must be root to run this tool!\n" exit 1 fi clear printf " #################################################### # # # This is a Shell-Based tool of l2tp installation # #

Centos7搭建pptp VPN一键安装脚本

Centos7搭建pptp一键安装脚本 废话不多说,先上脚本地址:Centos7一键pptp 使用: wget https://raw.githubusercontent.com/DanylZhang/VPS/master/CentOS7-pptp-host1plus.sh chmod +x ./CentOS7-pptp-host1plus.sh ./CentOS7-pptp-host1plus.sh -u your_username -p your_password 1 2 3 可在-u.-p

(转)【IPSEC】CentOS/Ubuntu一键安装IPSEC/IKEV2 VPN服务器

转载自quericy的博客(https://quericy.me) 花了点时间将上次的Ubuntu.CentOS搭建IPSec/IKEv2 VPN服务器全攻略整理成了一份一键安装的脚本.适用于WindowsPhone,iOS,Android和PC设备.有需要的童鞋可以拿来食用~ ~ ~ ~ CetnOS测试了下貌似没什么问题,Ubuntu的手里暂时没有空闲vps就没试了,其实也差不多的,欢迎测试和反馈 最新更新内容请见Github上的项目说明:https://github.com/quericy