Zookeeper异常:FAILED TO WRITE PID与Permission denied

缺乏、安全感 2022-12-29 04:51 318阅读 0赞

安装教程,请自己动手,详见:https://www.yiibai.com/zookeeper/zookeeper_installation.html

  1. /bin/echo -n $zkpid > "$ZOOPIDFILE"JMX enabled by default
  2. Using config: /opt/zookeeper/bin/../conf/zoo.cfg
  3. -n Starting zookeeper ...
  4. /opt/zookeeper/bin/zkServer.sh: line 103: /tmp/zookeeper/zookeeper_server.pid: No such file or directory
  5. FAILED TO WRITE PID

正确配置zoo.cfg 中dataDir:

  1. # The number of milliseconds of each tick
  2. tickTime=2000
  3. # The number of ticks that the initial
  4. # synchronization phase can take
  5. initLimit=10
  6. # The number of ticks that can pass between
  7. # sending a request and getting an acknowledgement
  8. syncLimit=5
  9. # the directory where the snapshot is stored.
  10. # do not use /tmp for storage, /tmp here is just
  11. # example sakes.
  12. #dataDir=/tmp/zookeeper
  13. dataDir=/Users/apple/personal/software/apache-zookeeper-3.6.2-bin/data
  14. # the port at which the clients will connect
  15. clientPort=2181
  16. # the maximum number of client connections.
  17. # increase this if you need to handle more clients
  18. #maxClientCnxns=60
  19. #
  20. # Be sure to read the maintenance section of the
  21. # administrator guide before turning on autopurge.
  22. #
  23. # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
  24. #
  25. # The number of snapshots to retain in dataDir
  26. #autopurge.snapRetainCount=3
  27. # Purge task interval in hours
  28. # Set to "0" to disable auto purge feature
  29. #autopurge.purgeInterval=1
  30. ## Metrics Providers
  31. #
  32. # https://prometheus.io Metrics Exporter
  33. #metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider
  34. #metricsProvider.httpPort=7000
  35. #metricsProvider.exportJvmInfo=true

dataDir授权,增加写权限给任何用户:

  1. sudo chmod o+w /Users/apple/personal/software/apache-zookeeper-3.6.2-bin/data

日志输出修改bin/zkEnv.sh:

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3plbmdzaHVueWFv_size_16_color_FFFFFF_t_70

修改log4.properties:

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3plbmdzaHVueWFv_size_16_color_FFFFFF_t_70 1

然后再启动:

  1. sh bin/zkServer.sh start

查看服务状态:

  1. sh bin/zkServer.sh status

输出结果:

  1. ZooKeeper JMX enabled by default
  2. Using config: /Users/apple/personal/software/apache-zookeeper-3.6.2-bin/bin/../conf/zoo.cfg
  3. mkdir: illegal option -- e
  4. usage: mkdir [-pv] [-m mode] directory ...
  5. Client port found: 2181. Client address: localhost. Client SSL: false.
  6. Mode: standalone

ok.你已经是最靓的仔

发表评论

表情:
评论列表 (有 0 条评论,318人围观)

还没有评论,来说两句吧...

相关阅读