Configuring Embedded ZooKeeper for Apache NiFi Clusters: State Directory and myid File Setup
Hi,
Reading the latest NiFi manual from the Hortworks web site: http://docs.hortonworks.com/HDPDocuments/HDF1/HDF-1.2.0.1/bk_AdminGuide/content/index.html (this uses NiFi version 0.6.0.)
The manual talks about creating a 'state' directory you need to use, when you want to use "embedded zookeeper' for a clustered NiFi environment:
When using an embedded ZooKeeper, the ./conf/zookeeper.properties file has a property nameddataDir. By default, this value is set to./state/zookeeper. If more than one NiFi node is running an embedded ZooKeeper, it is important to tell the server which one it is. This is accomplished by creating a file named myid and placing it in ZooKeeper's data directory. The contents of this file should be the index of the server as specific by theserver.<number>. So for one of the ZooKeeper servers, we will accomplish this by performing the following commands:
cd $NIFI_HOME
mkdir state
mkdir state/zookeeper
echo 1 > state/zookeeper/myid
When I started looking around the directories, before running these commands from the manual, I found a 'state' directory already in out there in the same directory level as 'conf', 'logs' and 'bin'. The ONLY sub-directory under "state" was" "local".
I don't want to 'assume' anything. Should I use this 'state' directory and build a 'zookeeper' sub directory in it, then add the file called 'myid'? I am logged on as the root user trying to create this.

