Chinaunix首页 | 论坛 | 博客
  • 博客访问: 463157
  • 博文数量: 279
  • 博客积分: 4467
  • 博客等级: 上校
  • 技术积分: 2830
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-03 14:43
文章分类

全部博文(279)

文章存档

2013年(1)

2012年(39)

2011年(35)

2009年(29)

2008年(131)

2007年(44)

分类:

2008-06-13 13:40:03

7.  startwservices.pl
it will require "start_3306.sh";
implementation:
1. if all transaction status=1 or 2,
 the start crond and mysql..
 2. release port 3306..
 3. done.
Description: start ws1 services safely, it will start the mysql network connection and accept transaction.
Implementation:
1. remove the skip-networking from the /etc/my.cnf
2. restart mysql to accept remote connection for the transaction

return:
1. Done
2. Fail:

#!/usr/bin/perl
require '/opt/ws1/run_control.pl';
$mysql_status=`/sbin/service mysqld status`;
chomp($mysql_status);
$string="mysqld is stopped";
if ($mysql_status eq $string){
system "/sbin/service mysqld start";
}
my $stagedbh=DBI->connect("DBI:mysql:database=$localdatabase;host=$localdbhost","$localdbuser","$localdbpass",{'RaiseError'=>1, 'AutoCommit' => 0}) or die "cannot connect!\n";
open FILE,"$ws2/stop_table.txt" or die "can't open file:$!\n";
foreach(<FILE>){
#print "$_\n";


$sth=$stagedbh->prepare(qq/select status_flag from $_/);
$sth->execute();
while (@fmrow=$sth->fetchrow_array)
{
$row=$fmrow[0];
#print $row."\n";

  }
if ($row=='1'|| $row=='2'){
$status=1;

}
else {
#print "status_flag:$row\n";

$status=0;
print "table $_ have records remain!\n";
exit 0;
}
}
if($status==1){
#print "Start crond and mysql!\n";

system "/etc/init.d/crond start";
#system "/sbin/service mysqld start";

system "$ws2/start_3306.sh";
}
close FILE;
$stagedbh->disconnect();

#!/bin/sh
# chain policies
# set default policies
/sbin/iptables -P INPUT ACCEPT
/sbin/iptables -P OUTPUT ACCEPT
/sbin/iptables -P FORWARD ACCEPT

# flush tables

/sbin/iptables -F
/sbin/iptables -F INPUT
/sbin/iptables -F OUTPUT
/sbin/iptables -F FORWARD
/sbin/iptables -F -t mangle
/sbin/iptables -X
/sbin/iptables -F -t nat

# loopback rules

/sbin/iptables -A INPUT -i lo -j ACCEPT
/sbin/iptables -A OUTPUT -o lo -j ACCEPT

inbound_xf_toposgrd
outbound_xf_frmwmsgrd_hk
outbound_xf_frmwmsgrd_cn
inbound_xf_toposgrh
outbound_xf_frmwmsgrh_cn
outbound_xf_frmwmsgrh_hk
inbound_xf_toposgtd
outbound_xf_frmwmsgtd_cn
outbound_xf_frmwmsgtd_hk
inbound_xf_toposgth
outbound_xf_frmwmsgth_cn
outbound_xf_frmwmsgth_hk
inbound_xf_topositemmas
outbound_xf_frmdmsitemmas_cn
outbound_xf_frmdmsitemmas_hk
outbound_xf_frmdmsitemmas_hq
inbound_xf_topositemstore
outbound_xf_frmwmsitemstore_cn
outbound_xf_frmwmsitemstore_hk
outbound_xf_frmwmsitemstore_hq
inbound_xf_toposqtyadjd
outbound_xf_frmwmsqtyadjd_cn
outbound_xf_frmwmsqtyadjd_hk
inbound_xf_topositemmas_store
outbound_xf_frmwmsitemmas_store_cn
outbound_xf_frmwmsitemmas_store_hk
outbound_xf_frmwmsitemmas_store_hq
inbound_xf_toposqtyadjh
outbound_xf_frmwmsqtyadjh_cn
outbound_xf_frmwmsqtyadjh_hk
inbound_xf_topostrfind
outbound_xf_frmwmstrfind_cn
outbound_xf_frmwmstrfind_hk
inbound_xf_topostrfinh
outbound_xf_frmwmstrfinh_cn
outbound_xf_frmwmstrfinh_hk
inbound_xf_topostrfouth
outbound_xf_frmwmstrfouth_cn
outbound_xf_frmwmstrfouth_hk
inbound_xf_topostrfoutd
outbound_xf_frmwmstrfoutd_cn
outbound_xf_frmwmstrfoutd_hk
inbound_xf_topositempric
outbound_xf_frmdmsitempric_cn
outbound_xf_frmdmsitempric_hk
inbound_xf_toposcostadjh
outbound_xf_frmdmscostadjh_cn
outbound_xf_frmdmscostadjh_hk
inbound_xf_toposcostadjd
outbound_xf_frmdmscostadjd_cn
outbound_xf_frmdmscostadjd_hk

阅读(168) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~