亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
最近訪問(wèn)板塊 發(fā)新帖
查看: 6143 | 回復(fù): 5
打印 上一主題 下一主題

Use of uninitialized value $command in string eq at [復(fù)制鏈接]

論壇徽章:
1
IT運(yùn)維版塊每日發(fā)帖之星
日期:2015-10-08 06:20:00
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2015-05-27 19:48 |只看該作者 |倒序?yàn)g覽
/usr/local/mysql/bin/master_ip_failover –orig_master_host=xxx  –orig_master_ip=xxx  –command=stopssh –ssh_user=root
執(zhí)行總是報(bào)錯(cuò)
Use of uninitialized value $command in string eq at /usr/local/mysql/bin/master_ip_failover line 34#!/usr/bin/env perl

麻煩幫忙看下。
這是 MySQL mha 的一段程序。

#!/usr/bin/env perluse strict;
use warnings FATAL => 'all';

use Getopt::Long;

my (
    $command,          $ssh_user,        $orig_master_host, $orig_master_ip,
    $orig_master_port, $new_master_host, $new_master_ip,    $new_master_port
);

# my $vip = '172.16.21.119/24';  # Virtual IP
my $key = "1";
my $ssh_start_vip = "/sbin/ifconfig eth0key $vip";
my $ssh_stop_vip = "/sbin/ifconfig eth0key down";

GetOptions(
    'command=s'          => \$command,
    'ssh_user=s'         => \$ssh_user,
    'orig_master_host=s' => \$orig_master_host,
    'orig_master_ip=s'   => \$orig_master_ip,
    'orig_master_port=i' => \$orig_master_port,
    'new_master_host=s'  => \$new_master_host,
    'new_master_ip=s'    => \$new_master_ip,
    'new_master_port=i'  => \$new_master_port,
);

exit &main();

sub main {

    print "\n\nIN SCRIPT TEST====$ssh_stop_vip==$ssh_start_vip===\n\n";
    if ( $command eq "stop" || $command eq "stopssh" ) {

        # $orig_master_host, $orig_master_ip, $orig_master_port are passed.
        # If you manage master ip address at global catalog database,
        # invalidate orig_master_ip here.
        my $exit_code = 1;
        eval {
            print "Disabling the VIP on old master: $orig_master_host \n";
            &stop_vip();
            $exit_code = 0;
        };
        if ($@) {
            warn "Got Error: $@\n";
            exit $exit_code;
        }
        exit $exit_code;
    }
    elsif ( $command eq "start" ) {

        # all arguments are passed.
        # If you manage master ip address at global catalog database,
        # activate new_master_ip here.
        # You can also grant write access (create user, set read_only=0, etc) here.
        my $exit_code = 10;
        eval {
            print "Enabling the VIP - $vip on the new master - $new_master_host \n";
            &start_vip();
            $exit_code = 0;
        };
        if ($@) {
            warn $@;
            exit $exit_code;
        }
        exit $exit_code;
    }
    elsif ( $command eq "status" ) {
        print "Checking the Status of the script.. OK \n";
        `ssh $ssh_user\@cluster1 \" $ssh_start_vip \"`;
        exit 0;
    }
    else {
        &usage();
        exit 1;
    }
}

# A simple system call that enable the VIP on the new master
sub start_vip() {
    `ssh $ssh_user\@$new_master_host \" $ssh_start_vip \"`;
}
# A simple system call that disable the VIP on the old_master
sub stop_vip() {
    `ssh $ssh_user\@$orig_master_host \" $ssh_stop_vip \"`;
}

sub usage {
    print
    "Usage: master_ip_failover --command=start|stop|stopssh|status --orig_master_host=host --orig_master_ip=ip --orig_master_port=port --new_master_host=host --new_master_ip=ip --new_master_port=port\n";
}

論壇徽章:
1
IT運(yùn)維版塊每日發(fā)帖之星
日期:2015-10-08 06:20:00
2 [報(bào)告]
發(fā)表于 2015-05-27 20:45 |只看該作者
已解決。我自己的問(wèn)題。

求職 : 軟件工程師
論壇徽章:
3
程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-10-07 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2015-12-13 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2016-05-05 06:20:00
3 [報(bào)告]
發(fā)表于 2015-05-27 20:49 |只看該作者
$command 沒(méi)有被傳遞給值,你可以測(cè)試一下,通過(guò)命令行傳遞的數(shù)據(jù)能否在內(nèi)部被正常顯示。

論壇徽章:
7
酉雞
日期:2013-10-30 17:17:51水瓶座
日期:2014-01-25 14:47:21天秤座
日期:2014-02-20 09:49:50處女座
日期:2014-11-04 17:44:082015年亞洲杯之中國(guó)
日期:2015-03-09 17:21:312015亞冠之北京國(guó)安
日期:2015-06-01 16:58:552015亞冠之山東魯能
日期:2015-06-19 11:30:08
4 [報(bào)告]
發(fā)表于 2015-05-28 09:29 |只看該作者
use Carp qw( confess );
$SIG{__DIE__} =  \&confess;
$SIG{__WARN__} = \&confess;

在代碼中加上上面三行,能夠得到更詳細(xì)的信息,方便找到具體的原因。

論壇徽章:
0
5 [報(bào)告]
發(fā)表于 2016-09-22 15:33 |只看該作者
您好~
請(qǐng)問(wèn)你這個(gè)問(wèn)題是怎么解決的,謝謝~~~

論壇徽章:
0
6 [報(bào)告]
發(fā)表于 2016-09-22 15:39 |只看該作者
回復(fù) 2# logo111

您好~
請(qǐng)問(wèn)你這個(gè)問(wèn)題是怎么解決的,謝謝~~~
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國(guó)互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過(guò)ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP