尝试让 mongodb 在启动 Debian 9 时启动

尝试让 mongodb 在启动 Debian 9 时启动

所以当我输入: sudo update-rc.d mongod defaults

我得到:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_MEASUREMENT = "he_IL.UTF-8",
    LC_PAPER = "he_IL.UTF-8",
    LC_MONETARY = "he_IL.UTF-8",
    LC_NAME = "he_IL.UTF-8",
    LC_ADDRESS = "he_IL.UTF-8",
    LC_NUMERIC = "he_IL.UTF-8",
    LC_TELEPHONE = "he_IL.UTF-8",
    LC_IDENTIFICATION = "he_IL.UTF-8",
    LC_TIME = "he_IL.UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
update-rc.d: error: unable to read /etc/init.d/mongod

当我输入:sudo update-rc.d mongod enable

我得到:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_MEASUREMENT = "he_IL.UTF-8",
    LC_PAPER = "he_IL.UTF-8",
    LC_MONETARY = "he_IL.UTF-8",
    LC_NAME = "he_IL.UTF-8",
    LC_ADDRESS = "he_IL.UTF-8",
    LC_NUMERIC = "he_IL.UTF-8",
    LC_TELEPHONE = "he_IL.UTF-8",
    LC_IDENTIFICATION = "he_IL.UTF-8",
    LC_TIME = "he_IL.UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
update-rc.d: error: cannot find a LSB script for mongod

我还发现:sudo ls -al /etc/init.d/ | grep mongod什么也不返回。有什么想法吗?

答案1

当我输入:sudo update-rc.d mongod defaults

不要那样做。 update-rc.d不是一个让你直接运行的工具。它用于维护者脚本。在像您这样的 systemd 操作系统上,使用systemctl enablesystemctl disable

当我输入:sudo update-rc.d mongod enable

mongod无论如何, 该服务在 Debian 上都没有命名。mongod是 MongoDB 开发人员提供的服务定义中使用的服务名称。但 Debian 提供了自己的服务定义,并且在 Debian 上该服务被命名为mongodb.

sudo ls -al /etc/init.d/ | grep mongod不返回任何内容

mongodb-server这是您一开始就没有安装该软件包的症状。

关于您的语言环境的 Perl 消息是转移注意力的信息,几乎可以肯定是由于Debian 错误 #868695。 A本地修复是为了确保您的LANGUAGELC_ALL变量也由 shell 的登录脚本设置;但这与您的服务单位和丢失的文件无关。

相关内容