zoukankan      html  css  js  c++  java
  • zookeeper systemctl开机启动

    创建 /etc/systemd/system/zookeeper.service 文件,内容下

    [root@zookeep-kafka-node1 kafka_2.12-2.3.0]# cat /etc/systemd/system/zookeeper.service 
    [Unit]
    Description=zookeeper.service
    After=network.target
    ConditionPathExists=/opt/zookeeper-3.5.6/conf/zoo.cfg
    [Service]
    Type=forking
    Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin://usr/local/jdk1.8.0_231/bin"
    User=root
    Group=root
    ExecStart=/opt/zookeeper-3.5.6/bin/zkServer.sh start
    ExecStop=/opt/zookeeper-3.5.6/bin/zkServer.sh stop
    [Install]
    WantedBy=multi-user.target

    启动命令,开机启动

    [root@zookeep-kafka-node1 ~]# systemctl daemon-reload
    [root@zookeep-kafka-node1 ~]# systemctl enable zookeeper
    [root@zookeep-kafka-node1 ~]# systemctl start zookeeper
    [root@zookeep-kafka-node1 ~]# systemctl stop zookeeper
    

    报错:zkServer.sh[11717]: Error: JAVA_HOME is not set and java could not be found in PATH

    修改zkEnv.sh文件 增加JAVA_HOME

    [root@zookeep-kafka-node3 bin]# cat zkEnv.sh |grep -C 5 JAVA_HOME
    # or the conf directory that is
    # a sibling of this script's directory.
    # Or you can specify the ZOOCFGDIR using the
    # '--config' option in the command line.
    
    JAVA_HOME=/usr/local/jdk1.8.0_231
    ZOOBINDIR="${ZOOBINDIR:-/usr/bin}"
    ZOOKEEPER_PREFIX="${ZOOBINDIR}/.."
    
    #check to see if the conf dir is given as an optional argument
    

      

      

  • 相关阅读:
    js作用域链
    函数声明提升
    18年年终总结之谈谈焦虑这件事
    混合开发中ios兼容问题
    vue 缓存的keepalive页面刷新数据
    vue里监听安卓的物理返回键
    vue根据数组对象中某个唯一标识去重
    Sublime Text3 插件
    全面理解Javascript闭包和闭包的几种写法及用途
    javascript深入理解js闭包
  • 原文地址:https://www.cnblogs.com/caonw/p/11897386.html
Copyright © 2011-2022 走看看