You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Michi Mutsuzaki (JIRA)" <ji...@apache.org> on 2014/03/29 22:47:14 UTC

[jira] [Commented] (ZOOKEEPER-1785) Small fix in zkServer.sh to support new configuration format

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

Michi Mutsuzaki commented on ZOOKEEPER-1785:
--------------------------------------------

I couldn't quite reproduce the problem. I used a static conf file like this:

{noformat}
dataDir=/tmp/zktest/data0
syncLimit=2
tickTime=2000
initLimit=5
server.0=localhost:2000:3000:participant;localhost:4000
server.1=localhost:2001:3001:participant;localhost:4001
server.2=localhost:2002:3002:participant;localhost:4002
{noformat}

but the server generates .dynamic conf file when it starts, so the status command succeeds without this patch. I verified the patch correctly finds the client port from the static conf file by running the status command before starting the server. [~shralex], doesn't the server always generate .dynamic conf file during startup, or is there a case where the .dynamic conf file doesn't get generated?

> Small fix in zkServer.sh to support new configuration format
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1785
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1785
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 3.5.0
>            Reporter: Alexander Shraer
>            Assignee: Alexander Shraer
>            Priority: Minor
>             Fix For: 3.5.0
>
>         Attachments: zkServersh.patch
>
>
> The problem can be reproduced by running a server with the following type of config file:
> dataDir=/Users/shralex/zookeeper-test/zookeeper1
> syncLimit=2
> initLimit=5
> tickTime=2000
> server.1=localhost:2721:2731:participant;2791
> server.2=localhost:2722:2732:participant;2792
> and then trying to do "zkServer.sh status"
> Here I specified the servers using the new config format but still used the static config file and didn't include the "clientPort" key.
> zkServer.sh already supports the new configuration format, but expects server spec to appear in the dynamic config file if it uses the new format.
> So in the example above it will not find the client port. 
> The current logic for executing something like 'zkServer.sh status'  is:
> 1. Look for clientPort keyword in the static config file
> 2. Look for the client port in the server spec in the dynamic config file
> The attached patch adds an intermediate step:
> 1'. Look for the client port in the server spec in the static config file



--
This message was sent by Atlassian JIRA
(v6.2#6252)