From user-return-11554-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Mon Jul 16 11:48:32 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 EAF7D180657 for ; Mon, 16 Jul 2018 11:48:31 +0200 (CEST) Received: (qmail 29781 invoked by uid 500); 16 Jul 2018 09:48:30 -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 29765 invoked by uid 99); 16 Jul 2018 09:48:30 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jul 2018 09:48:30 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id AB5D01A2575 for ; Mon, 16 Jul 2018 09:48:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.998 X-Spam-Level: * X-Spam-Status: No, score=1.998 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id nM44v29WfQEb for ; Mon, 16 Jul 2018 09:48:28 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-oln040092064049.outbound.protection.outlook.com [40.92.64.49]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 897D05F1EA for ; Mon, 16 Jul 2018 09:48:27 +0000 (UTC) Received: from DB5EUR01FT017.eop-EUR01.prod.protection.outlook.com (10.152.4.54) by DB5EUR01HT171.eop-EUR01.prod.protection.outlook.com (10.152.5.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.952.17; Mon, 16 Jul 2018 09:48:19 +0000 Received: from VI1P191MB0319.EURP191.PROD.OUTLOOK.COM (10.152.4.57) by DB5EUR01FT017.mail.protection.outlook.com (10.152.4.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.952.17 via Frontend Transport; Mon, 16 Jul 2018 09:48:19 +0000 Received: from VI1P191MB0319.EURP191.PROD.OUTLOOK.COM ([fe80::d5b9:d962:6c25:9eb3]) by VI1P191MB0319.EURP191.PROD.OUTLOOK.COM ([fe80::d5b9:d962:6c25:9eb3%4]) with mapi id 15.20.0952.021; Mon, 16 Jul 2018 09:48:19 +0000 From: adrien ruffie To: "user@zookeeper.apache.org" Subject: RE: zookeeper as systemd Thread-Topic: zookeeper as systemd Thread-Index: AQHUGrypHNM3C6DJ20OunnQSh3VVhaSRhNeAgAAXKTA= Date: Mon, 16 Jul 2018 09:48:19 +0000 Message-ID: References: , In-Reply-To: Accept-Language: fr-FR, en-US Content-Language: fr-FR X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:5048E12050784249432D88DEB2428EEA21E74831A47E10CCFEA21625BDA39680;UpperCasedChecksum:FE3337545626DD6AA30E1D5218B6A0EA021F247584AE854E4A7DFFAA59244320;SizeAsReceived:7114;Count:46 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [BTMYBxWg7KYyx4GjVouwHHjAg6+5qpL/] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DB5EUR01HT171;7:PtPi3eABL7am8tn9Gv+5M5BPzUhMTD1OAtB6QjqZx5FRS1s0Oj7xacci0eQrwBV8tLs9AXCoVNo1yOalsTKABBX1YpmRJ9hs4fd2MfaIEXAiqeUL3ivvR87NLxv8Pscms3WvAe/Iv3tDAZEJRucrCWeeSoRbfhW+L2ZSRsdX2M8KFC9vDx6aQFKv8BiVmziBHT54rSyaN98nSKrnpY0gbcnp8AxlMcWKHpA8/AmNhUESAz2fwj6cRCK3gxQI+/Pw x-incomingheadercount: 46 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1603101448)(1601125500)(1701031045);SRVR:DB5EUR01HT171; x-ms-traffictypediagnostic: DB5EUR01HT171: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(82015058);SRVR:DB5EUR01HT171;BCL:0;PCL:0;RULEID:;SRVR:DB5EUR01HT171; x-forefront-prvs: 073515755F x-forefront-antispam-report: SFV:NSPM;SFS:(7070007)(199004)(189003)(486006)(105586002)(76176011)(14454004)(6916009)(8936002)(7116003)(5660300001)(19627405001)(606006)(106356001)(16799955002)(56003)(68736007)(26005)(86362001)(6606003)(81156014)(8676002)(25786009)(1730700003)(7696005)(97736004)(229853002)(3480700004)(82202002)(45080400002)(6346003)(53546011)(5250100002)(11346002)(6306002)(236005)(446003)(6506007)(256004)(2501003)(6246003)(74482002)(2351001)(2900100001)(5640700003)(102836004)(73972006)(6436002)(476003)(86152003)(55016002)(54896002)(966005)(104016004)(99286004)(74316002)(33656002)(9686003);DIR:OUT;SFP:1901;SCL:1;SRVR:DB5EUR01HT171;H:VI1P191MB0319.EURP191.PROD.OUTLOOK.COM;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:; received-spf: None (protection.outlook.com: hotmail.fr does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=adriennolarsen@hotmail.fr; x-microsoft-antispam-message-info: aByWpBGl3JYkyw2BGCVHZZrJtTA40NuDXBkhlPCy+sMNVVwmW+cXzbJzv675LhllcdCA5hqwKqKoZ80HKDvfVmwKVS8Kj9zprka9zR9dY9RUI/cjcM/fPABOKKw7tWo+vkA7usXZhM+xzyniS4rWt1coqMpgZqA7JDzYlKEI+2Cs+jdi/UOXYJRID5iS59uiyzjSjTOUEN8poZVQoJa7Vig5EuCxT7aQavX47wLWKDQ= Content-Type: multipart/alternative; boundary="_000_VI1P191MB03199AE3F21FEEB3530B77A4A95D0VI1P191MB0319EURP_" MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 074d7d4d-72e2-4a0a-9d89-73b16535e4cd X-MS-Exchange-CrossTenant-Network-Message-Id: 853ba70d-d74a-4a98-ab6b-08d5eb0142d3 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 074d7d4d-72e2-4a0a-9d89-73b16535e4cd X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jul 2018 09:48:19.0865 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5EUR01HT171 --_000_VI1P191MB03199AE3F21FEEB3530B77A4A95D0VI1P191MB0319EURP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thank Nobert ! It really help me, according to you, what would you recommend? To launch with "Type=3Dsimple" and zkServer.sh start ? Or "Type=3Dforking" and zkServer.sh start ? Because start command launch Zookeeper as a Daemon, but if I use "Type=3Dsimple" the system already daemonize the process ... Do you think that can be daemonize a daemon ... ? Strange I really ready to use "Type=3Dforking" option but, according to this follow= ing post https://bbs.archlinux.org/viewtopic.php?id=3D191669 the "Type=3Dforking" is not really recommended ... what do you think ? Adrien ________________________________ De : Norbert Kalmar Envoy=E9 : lundi 16 juillet 2018 10:15 =C0 : user@zookeeper.apache.org Objet : Re: zookeeper as systemd 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=3Dnetwork.target" ? ' - ZooKeeper should only start aft= er the network... available? I think this should be something like After=3Dnetwork-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=3Dalways ? RestartSec=3D0s ? > > What is "After=3Dnetwork.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=3DZooKeeper > > [Service] > Type=3Dsimple > User=3Dzookeeper > Group=3Dzookeeper > ExecStart=3D/usr/local/zookeeper-3.4.9/bin/zkServer.sh start-foreground > > TimeoutSec=3D300 > > [Install] > WantedBy=3Dmulti-user.target > > ------------------- But I found this following on a blog: > > > [Unit] > Description=3DApache Zookeeper > After=3Dnetwork.target > > [Service] > Type=3Dforking > User=3Dzookeeper > Group=3Dzookeeper > SyslogIdentifier=3Dzookeeper > Restart=3Dalways > RestartSec=3D0s > ExecStart=3D/usr/bin/zookeeper-server start > ExecStop=3D/usr/bin/zookeeper-server stop > ExecReload=3D/usr/bin/zookeeper-server restart > > [Install] > WantedBy=3Dmulti-user.target > > > Thank you very much and best regards > > Adrien > --_000_VI1P191MB03199AE3F21FEEB3530B77A4A95D0VI1P191MB0319EURP_--