GssFlyaway
GssFlyaway

Reputation: 105

Zookeeper dataLogDir config invalid

I built a zookeeper cluster and it runs very well. But I found that the log directory I set in the zoo.cfg seems not working. Below is my config about log directory and snapshots directory.

dataDir=/var/lib/zookeeper
dataLogDir=/var/lib/zookeeper/logs

However, file zookeeper.out is generated in /var/lib/zookeeper rather than the subsidiary log folder /var/lib/zookeeper/logs.

I restarted zookeeper on every server many times, but made no sense.

Upvotes: 2

Views: 1658

Answers (1)

Adrian
Adrian

Reputation: 3711

This happens because zookeeper.out is related to other type of log (application log) instead of the one specified by dataLogDir which relates to transaction log.

dataLogDir
This option will direct the machine to write the transaction log to the dataLogDir rather than the dataDir. This allows a dedicated log device to be used, and helps avoid competition between logging and snaphots.

By checking zkServer.sh you'll see that zookeeper.out is related to _ZOO_DAEMON_OUT which depends on ZOO_LOG_DIR which is set by default by zkEnv.sh. Depending on your environment and zookeeper (ZK) version the zookeeper.out file might land in different places (according to this answer even in the working directory from which ZK is started). For application logging you'll better configure the log4j.properties file; that's because ZK uses log4j.

Upvotes: 2

Related Questions