# 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=/opt/zookeeper/data dataLogDir=/opt/zookeeper/logs # the port at which the clients will connect clientPort=2181 # 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
之所以配置NFS是因为配置Flink的zookeeper HA 服务需要配置可共享的文件存储(High-availability.storageDir must be a durable file system that is accessible from all nodes)官方示例给的hdfs,但是考虑到hdfs太笨重,我们的任务量也不大,我选择了更轻量的NFS。我的NFS服务是直接向同事申请的,同事提供了远程目录,我直接挂载到我的三台jobmanager服务器的/mnt/flink/ha/位置,之后这个目录就将配置为flink中的High-availability.storageDir