[
https://issues.apache.org/jira/browse/NIFI-2478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15407441#comment-15407441
]
ASF GitHub Bot commented on NIFI-2478:
--------------------------------------
GitHub user ijokarumawak opened a pull request:
https://github.com/apache/nifi/pull/783
NIFI-2478 Fixed Zk leaders path to include root.
This enables the same Zookeeper to be used by multiple NiFi clusters.
Please see the [NIFI-2478](https://issues.apache.org/jira/browse/NIFI-2478) for
detail.
I've tested with a dedicated external zookeeper and two NiFi clusters,
confirmed clustering functionalities works fine.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ijokarumawak/nifi nifi-2478
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/783.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #783
----
commit 9dd1b1eafc44951a52742edd4eb985902f5abbdc
Author: Koji Kawamura <[email protected]>
Date: 2016-08-04T08:16:21Z
NIFI-2478 Fixed Zk leaders path to include root.
----
> Can not use the same Zookeeper with multiple cluster
> ----------------------------------------------------
>
> Key: NIFI-2478
> URL: https://issues.apache.org/jira/browse/NIFI-2478
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 1.0.0
> Reporter: Koji Kawamura
>
> I am trying to use the same external Zookeeper from two NiFi clusters. It's
> expected this deployment is supported since there is
> 'nifi.zookeeper.root.node' setting.
> Set 'nifi.zookeeper.root.node' to '/nifi-cluster-1' for cluster-1, and
> '/nifi-cluster-2' for cluster-2.
> Cluster-1 started successfully. But Cluster-2 can't start with following
> error:
> {code}
> 2016-08-04 07:45:58,787 INFO [main] o.a.c.f.imps.CuratorFrameworkImpl Starting
> 2016-08-04 07:45:58,794 INFO [main-EventThread]
> o.a.c.f.state.ConnectionStateManager State change: CONNECTED
> 2016-08-04 07:45:58,795 INFO [main] o.a.n.c.c.node.CuratorNodeProtocolSender
> No node has yet been elected Cluster Coordinator. Cannot establish connection
> to cluster yet.
> 2016-08-04 07:45:58,795 INFO [Curator-Framework-0]
> o.a.c.f.imps.CuratorFrameworkImpl backgroundOperationsLoop exiting
> 2016-08-04 07:45:58,797 WARN [main] o.a.nifi.controller.StandardFlowService
> Failed to connect to cluster due to:
> org.apache.nifi.cluster.protocol.ProtocolException: No node has yet been
> elected Cluster Coordinator. Cannot establish connection to cluster yet.
> org.apache.nifi.cluster.protocol.ProtocolException: No node has yet been
> elected Cluster Coordinator. Cannot establish connection to cluster yet.
> at
> org.apache.nifi.cluster.coordination.node.CuratorNodeProtocolSender.getServiceAddress(CuratorNodeProtocolSender.java:108)
> ~[nifi-framework-cluster-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
> {code}
> I looked at the Zookeeper znodes and found 'leaders' is not under configured
> root node:
> {code}
> [zk: localhost:2181(CONNECTED) 17] ls /
> [leaders, nifi-cluster-1, zookeeper]
> {code}
> Then, I looked at the source code, and found CuratorLeaderElectionManager has
> following code:
> {code}
> final String rootPath = zkConfig.getRootPath();
> final String leaderPath = (rootPath.endsWith("/") ? "" : "/") +
> "leaders/" + roleName;
> {code}
> It doesn't include rootPath while it should.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)