【问题标题】:Why is rhel8 aws systemd service throws No such file or directory error even when file exists?为什么即使文件存在,rhel8 aws systemd 服务也会抛出 No such file or directory 错误?
【发布时间】:2020-10-30 00:37:10
【问题描述】:

我在 rhel8 上定义了一个 systemd 服务

[Unit]
Description=Apache Kafka - ZooKeeper
Documentation=http://docs.confluent.io/
After=network.target

[Service]
Type=simple
EnvironmentFile=/app/bin/confluent/etc/kafka/zookenv.properties
User=kafka
Group=kafka
ExecStart=/app/bin/confluent/bin/zookeeper-server-start /app/bin/confluent/etc/kafka/zookeeper.properties
TimeoutStopSec=180
Restart=no

[Install]
WantedBy=multi-user.target

当我启动此服务时,journalctl 中出现以下错误

Jul 09 12:00:51 10.204.142.111 systemd[1]: confluent-zookeeper.service: Failed to load environment files: No such file or directory
Jul 09 12:00:51 10.204.142.111 systemd[1]: confluent-zookeeper.service: Failed to run 'start' task: No such file or directory
Jul 09 12:00:51 10.204.142.111 systemd[1]: confluent-zookeeper.service: Failed with result 'resources'.

环境文件存在于路径中,启动脚本和属性文件也存在。

这是在 RHEL8 aws 上,第一次尝试。

当我从命令行手动运行启动脚本时,组件启动正常。

【问题讨论】:

    标签: linux amazon-ec2 systemd rhel rhel8


    【解决方案1】:

    检查路径和文件

    EnvironmentFile=/app/bin/confluent/etc/kafka/zookenv.properties
    

    正确

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-04-24
      • 2016-11-01
      • 2017-04-24
      • 2020-07-15
      • 2020-03-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多