Setup and Start Zookeeper Nodes
Perform the following steps if you have installed index search server on Solaris platform:
1. Create a data directory for each Zookeeper node. For example:
/opt/ptc/commondata/zkdata/node1
/opt/ptc/commondata/zkdata/node2
/opt/ptc/commondata/zkdata/node3
2. Create a file named “myid” to identify the Zookeeper node. The content of the file should identify the node.
For example, the content of the following myid file is simply the number 1:
/opt/ptc/commondata/zkdata/node1/myid
Similarly, enter 2 into node2/myid, and 3 into node3/myid.
* 
These are the IDs assigned to Zookeeper, and are used in zoo.cfg in the next step.
3. Create the Zookeeper configuration file:
<INDEX_SEARCH_HOME>\zookeeper\conf\zoo.cfg
where <INDEX_SEARCH_HOME> is the installation directory in which the index search server is installed.
Add the following content for node1:
# The number of milliseconds of each tick
tickTime=2000

# The number of ticks that the initial
# synchronization phase can take
initLimit=10

# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5

# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=D:\\ptc\\commondata\\zkdata\\node1 OR /opt/ptc/commondata/zkdata/node1

# the port at which the clients will connect
clientPort=<port#>

server.1=<host1>.ptcnet.ptc.com:2888:3888
server.2=<host2>.ptcnet.ptc.com:2889:3889
server.3=<host3>.ptcnet.ptc.com:2890:3890

# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#autopurge.purgeInterval=1
The following properties should be unique and specified for each Zookeeper node:
dataDir
Data directory for the Zookeeper node.
clientPort
Port on which Zookeeper listens to requests.
4. Start all Zookeeper nodes by executing the following command:
sh <INDEX_SEARCH_HOME>\zookeeper\bin\zkServer.sh start
* 
When a Zookeeper node is started, it will begin communicating with other Zookeeper nodes specified in the ensemble configuration (zoo.cfg).
During the start-up, you might see errors in the console or logs reporting that the node is unable to connect to other Zookeeper nodes. This is because those nodes have not been started. These errors can be ignored.
Est-ce que cela a été utile ?