ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-905

enhance zkServer.sh for easier zookeeper automation-izing

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.0
    • Component/s: scripts
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      zkServer.sh is good at starting zookeeper and figuring out the right options to pass along.

      unfortunately if you want to wrap zookeeper startup/shutdown in any significant way, you have to reimplement a bunch of the logic there.

      the attached patch addresses a couple simple issues:
      1. add a 'start-foreground' option to zkServer.sh - this allows things that expect to manage a foregrounded process (daemontools, launchd, etc) to use zkServer.sh instead of rolling their own to launch zookeeper

      2. add a 'print-cmd' option to zkServer.sh - rather than launching zookeeper from the script, just give me the command you'd normally use to exec zookeeper. I found this useful when writing automation to start/stop zookeeper as part of smoke testing zookeeper-based applications

      3. Deal more gracefully with supplying alternate configuration files to zookeeper - currently the script assumes all config files reside in $ZOOCFGDIR - also useful for smoke testing

      4. communicate extra info ("JMX enabled") about zookeeper on STDERR rather than STDOUT (necessary for #2)

      5. fixes an issue on macos where readlink doesn't have the '-f' option.

      1. zkServer.sh.diff
        2 kB
        Nicholas Harteau

        Activity

        Hide
        Nicholas Harteau added a comment -

        patch to bin/zkServer.sh@r1024408

        Show
        Nicholas Harteau added a comment - patch to bin/zkServer.sh@r1024408
        Hide
        Nicholas Harteau added a comment -

        patch against zkServer.sh@r1024408

        Show
        Nicholas Harteau added a comment - patch against zkServer.sh@r1024408
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12457610/zkServer.sh.diff
        against trunk revision 1032885.

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        -1 patch. The patch command could not apply the patch.

        Console output: https://hudson.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/3//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12457610/zkServer.sh.diff against trunk revision 1032885. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. -1 patch. The patch command could not apply the patch. Console output: https://hudson.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/3//console This message is automatically generated.
        Hide
        Nicholas Harteau added a comment -

        assume that hudson calls patch from srcroot with -p1

        Show
        Nicholas Harteau added a comment - assume that hudson calls patch from srcroot with -p1
        Hide
        Nicholas Harteau added a comment -

        make patch hudson-friendly.

        Show
        Nicholas Harteau added a comment - make patch hudson-friendly.
        Hide
        Nicholas Harteau added a comment -

        apparently this gets called with -p0

        Show
        Nicholas Harteau added a comment - apparently this gets called with -p0
        Hide
        Patrick Hunt added a comment -

        Hi Nicholas, actually the issue is that you need to use svn to create the diff (hudson doesn't like the fact that it doesn't know what .orig file is)

        See this page for instructions (basically checkout svn, make change, do "svn diff")
        http://wiki.apache.org/hadoop/ZooKeeper/HowToContribute

        Show
        Patrick Hunt added a comment - Hi Nicholas, actually the issue is that you need to use svn to create the diff (hudson doesn't like the fact that it doesn't know what .orig file is) See this page for instructions (basically checkout svn, make change, do "svn diff") http://wiki.apache.org/hadoop/ZooKeeper/HowToContribute
        Hide
        Nicholas Harteau added a comment -

        svn diff vs. release-3.3.1 (thanks patrick)

        Show
        Nicholas Harteau added a comment - svn diff vs. release-3.3.1 (thanks patrick)
        Hide
        Patrick Hunt added a comment -

        Hi Nicholas, thanks!

        You've currently got the workflow in "inprogress" mode, iirc this happens when you "resume progress" or something like that (we typically don't use that part of the workflow, if the issue is assigned to you the assumption is that you are working on it unless we hear otw). You'll need to take the jira out of "inprogress" mode and then select "submit patch" for this to go to the qabot and then get reviewed/comitted by a committer.

        One other FYI, this jira is assigned to be fixed in 3.4.0 (current trunk, ie the next full trunk release). Typically you'd want to create the patch against svn trunk. Also, the patch queue on hudson (qa bot) will only test patches against trunk. Not a big deal (your patch may apply against trunk even if created from 3.3.1) but I just wanted to give you that headsup.

        Thanks again. Regards.

        Show
        Patrick Hunt added a comment - Hi Nicholas, thanks! You've currently got the workflow in "inprogress" mode, iirc this happens when you "resume progress" or something like that (we typically don't use that part of the workflow, if the issue is assigned to you the assumption is that you are working on it unless we hear otw). You'll need to take the jira out of "inprogress" mode and then select "submit patch" for this to go to the qabot and then get reviewed/comitted by a committer. One other FYI, this jira is assigned to be fixed in 3.4.0 (current trunk, ie the next full trunk release). Typically you'd want to create the patch against svn trunk. Also, the patch queue on hudson (qa bot) will only test patches against trunk. Not a big deal (your patch may apply against trunk even if created from 3.3.1) but I just wanted to give you that headsup. Thanks again. Regards.
        Hide
        Mahadev konar added a comment -

        The patch looks good and applies to trunk. +1 to the patch, I am marking this as PA.

        Show
        Mahadev konar added a comment - The patch looks good and applies to trunk. +1 to the patch, I am marking this as PA.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12459259/zkServer.sh.diff
        against trunk revision 1034003.

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        -1 javadoc. The javadoc tool appears to have generated 1 warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed core unit tests.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://hudson.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/31//testReport/
        Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/31//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://hudson.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/31//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12459259/zkServer.sh.diff against trunk revision 1034003. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. -1 javadoc. The javadoc tool appears to have generated 1 warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: https://hudson.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/31//testReport/ Findbugs warnings: https://hudson.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/31//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://hudson.apache.org/hudson/job/PreCommit-ZOOKEEPER-Build/31//console This message is automatically generated.
        Hide
        Mahadev konar added a comment -

        I just committed this to trunk. Thanks a lot nicholas.

        Show
        Mahadev konar added a comment - I just committed this to trunk. Thanks a lot nicholas.
        Hide
        Hudson added a comment -

        Integrated in ZooKeeper-trunk #1031 (See https://hudson.apache.org/hudson/job/ZooKeeper-trunk/1031/)

        Show
        Hudson added a comment - Integrated in ZooKeeper-trunk #1031 (See https://hudson.apache.org/hudson/job/ZooKeeper-trunk/1031/ )

          People

          • Assignee:
            Nicholas Harteau
            Reporter:
            Nicholas Harteau
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development