[ 
https://issues.apache.org/jira/browse/TRAFODION-2940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16388992#comment-16388992
 ] 

ASF GitHub Bot commented on TRAFODION-2940:
-------------------------------------------

Github user kevinxu021 commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1427#discussion_r172736094
  
    --- Diff: dcs/src/main/java/org/trafodion/dcs/master/FloatingIp.java ---
    @@ -61,6 +61,43 @@ public boolean isEnabled() {
             return isEnabled;
         }
     
    +    public synchronized int unbindScript() throws Exception {
    +        if (isEnabled)
    +            LOG.info("Floating IP is enabled");
    +        else {
    +            LOG.info("Floating IP is disabled");
    +            return 0;
    +        }
    +
    +        ScriptContext scriptContext = new ScriptContext();
    +        scriptContext.setScriptName(Constants.SYS_SHELL_SCRIPT_NAME);
    +        scriptContext.setStripStdOut(false);
    +        scriptContext.setStripStdErr(false);
    +
    +        String command = 
master.getConfiguration().get(Constants.DCS_MASTER_FLOATING_IP_COMMAND_UNBIND,
    +                Constants.DEFAULT_DCS_MASTER_FLOATING_IP_COMMAND_UNBIND);
    +
    +        scriptContext.setCommand(command);
    +        LOG.info("Unbind Floating IP [" + scriptContext.getCommand() + 
"]");
    +        ScriptManager.getInstance().runScript(scriptContext);// Blocking 
call
    +
    +        StringBuilder sb = new StringBuilder();
    +        sb.append("exit code [" + scriptContext.getExitCode() + "]");
    +        if (!scriptContext.getStdOut().toString().isEmpty())
    +            sb.append(", stdout [" + scriptContext.getStdOut().toString() 
+ "]");
    +        if (!scriptContext.getStdErr().toString().isEmpty())
    +            sb.append(", stderr [" + scriptContext.getStdErr().toString() 
+ "]");
    +        if (LOG.isErrorEnabled())
    +            LOG.info(sb.toString());
    +
    +        if (scriptContext.getExitCode() == 0)
    +            LOG.info("Unbind Floating IP successful");
    +        else
    +            LOG.error("Unbind Floating IP failed");
    --- End diff --
    
    It's better to print exit code.


> In HA env, one node lose network, when recover, trafci can't use
> ----------------------------------------------------------------
>
>                 Key: TRAFODION-2940
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2940
>             Project: Apache Trafodion
>          Issue Type: Bug
>    Affects Versions: any
>            Reporter: mashengchen
>            Assignee: mashengchen
>            Priority: Major
>             Fix For: 2.3
>
>
> In HA env, if one node lose network for a long time , once network recover, 
> there will have two floating ip, two working dcs master, and trafci can't be 
> use.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to