From user-return-11553-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Mon Jul 16 10:15:52 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 90280180657 for ; Mon, 16 Jul 2018 10:15:51 +0200 (CEST) Received: (qmail 70365 invoked by uid 500); 16 Jul 2018 08:15:50 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 70353 invoked by uid 99); 16 Jul 2018 08:15:49 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jul 2018 08:15:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 10E77C044E for ; Mon, 16 Jul 2018 08:15:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.909 X-Spam-Level: * X-Spam-Status: No, score=1.909 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_KAM_HTML_FONT_INVALID=0.01] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=cloudera.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id LTtFKhr3Gwmj for ; Mon, 16 Jul 2018 08:15:48 +0000 (UTC) Received: from mail-pl0-f41.google.com (mail-pl0-f41.google.com [209.85.160.41]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id A63555F19D for ; Mon, 16 Jul 2018 08:15:47 +0000 (UTC) Received: by mail-pl0-f41.google.com with SMTP id 6-v6so14932368plb.0 for ; Mon, 16 Jul 2018 01:15:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=ruQg4fAy4liyYK7mkBYrNSwRbGEKTsYL+L/c+jXIsWM=; b=oRTsBn2xNnGN7RowRHoolUOhXBmol1vTSzDYNwxWxsXIrN3BzFgw63MvLmP3ZAQaHX uxLWBeDismpOAuev5YU3SEpoXzQI0Nm7Oca2IplOHN/xaoTGmqqL6as0IztZhgVxfKVD YUrTzaBkQcmG8pW8Ko1d+NsRg2TipWENx/BCGG+zo50G5rJr9kYhU92KQzPcIGi+us+T 9hlW9vV06P06jxSmUPHMboLuW4BNF2giLrPmv34ejrHaSLpPMcYonX2EpGID59w4k5Un 3pHw3ThM/lhm5+Zwge+b6Jjh1Byx1lHry7L+22CZVFcAQ6Bc76PPUlySll2RcuSMRvAD UE1g== X-Gm-Message-State: AOUpUlEWVD9Kkw4istNKHf8K2nNkE+XkNo9Iqe+k9VaT/Lk37shhsIhD qPfAsYivDnPbtkzENb3NCt0GWk+G5B6IwmRJa64iqw2E X-Google-Smtp-Source: AAOMgpf3Anx3dRRl0JPvLVnvN6TeCPl/KKmFAIwMWlzzWRNILNzGKtsxeqk677s26wCdEWMkUEjCbgKHkTB1h0TQ+Mg= X-Received: by 2002:a17:902:8:: with SMTP id 8-v6mr16036695pla.287.1531728941103; Mon, 16 Jul 2018 01:15:41 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Norbert Kalmar Date: Mon, 16 Jul 2018 10:15:29 +0200 Message-ID: Subject: Re: zookeeper as systemd To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary="0000000000006d5d4b0571196fa0" --0000000000006d5d4b0571196fa0 Content-Type: text/plain; charset="UTF-8" Hi Adrien, zkServer.sh start-foreground - starts the ZooKeeper process in the foreground. Good for debugging (thats what I use it for), or check something, as you will have the logs printed to standard output (console most probably). The "start" is what you want to use in production environment. the process will run in the background. ' What is "After=network.target" ? ' - ZooKeeper should only start after the network... available? I think this should be something like After=network-online.target But looking at the others, I'm not entirely sure either what they really do. But checko out this jira - https://issues.apache.org/jira/browse/ZOOKEEPER-2095 There was a patch about this, and they added systemd startup/conf files. Sorry, this is all I could come up with, as I'm not familiar with this part either. Hope it helps. Regards, Norbert On Fri, Jul 13, 2018 at 5:30 PM adrien ruffie wrote: > Hello Zookeeper's users, > > > I have 2 questions for you. > > > what is the real difference between these 2 following commands ? (I don't > find any documentation) > > > zkServer.sh start-foreground > > and > > zkServer.sh start > > > > My second question is, how I can correctly start my zookeeper as a > systemclt service ? > > What is the common best template to write into > /etc/systemd/system/zookeeper.service ? > > Do you use Restart=always ? RestartSec=0s ? > > What is "After=network.target" ? > > If my Zookeeper does not really start in 300 sec, the process will be > shutdown ? > > > Do you have any example of zookeeper service file ? > > > Because our zookeeper.service is right now: > > > [Unit] > Description=ZooKeeper > > [Service] > Type=simple > User=zookeeper > Group=zookeeper > ExecStart=/usr/local/zookeeper-3.4.9/bin/zkServer.sh start-foreground > > TimeoutSec=300 > > [Install] > WantedBy=multi-user.target > > ------------------- But I found this following on a blog: > > > [Unit] > Description=Apache Zookeeper > After=network.target > > [Service] > Type=forking > User=zookeeper > Group=zookeeper > SyslogIdentifier=zookeeper > Restart=always > RestartSec=0s > ExecStart=/usr/bin/zookeeper-server start > ExecStop=/usr/bin/zookeeper-server stop > ExecReload=/usr/bin/zookeeper-server restart > > [Install] > WantedBy=multi-user.target > > > Thank you very much and best regards > > Adrien > --0000000000006d5d4b0571196fa0--