我无法为 Lightbend ConductR 配置 Docker 虚拟机。沙箱初始化抛出 FileNotFoundError

I am not able to configure Docker VM for Lightbend ConductR. Sandbox init is throwing FileNotFoundError

我正在试用 Lighbend 的 ConductR,目前一直在设置沙箱。我按照他们 site 上给出的说明进行操作,但在步骤 "Configure Docker VM" 中遇到以下错误 - 当我尝试执行沙箱初始化时:

shishir@shishir-VirtualBox:~/Lightbend$ sudo sandbox init
Warning: Docker has an insufficient no. of CPUs 1 - please increase to a minimum of 4 CPUs
Error: Encountered unexpected error.
Error: Reason: FileNotFoundError [Errno 2] No such file or directory: 'docker-machine'
Error: Further information of the error can be found in the error log file: /home/shishir/.conductr/errors.log
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/conductr_cli/main_handler.py", line 8, in run
    result = callback()
  File "/usr/local/lib/python3.5/dist-packages/conductr_cli/sandbox.py", line 6, in main_method
    sandbox_main.run()
  File "/usr/local/lib/python3.5/dist-packages/conductr_cli/sandbox_main.py", line 158, in run
    args.func(args)
  File "/usr/local/lib/python3.5/dist-packages/conductr_cli/sandbox_init.py", line 32, in init
    if is_docker_machine_installed():
  File "/usr/local/lib/python3.5/dist-packages/conductr_cli/sandbox_init.py", line 104, in is_docker_machine_installed
    terminal.docker_machine_help()
  File "/usr/local/lib/python3.5/dist-packages/conductr_cli/terminal.py", line 71, in docker_machine_help
    return subprocess.check_output(cmd, universal_newlines=True).strip()
  File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.5/subprocess.py", line 693, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'docker-machine'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/sandbox", line 9, in <module>
    load_entry_point('conductr-cli==0.39', 'console_scripts', 'sandbox')()
  File "/usr/local/lib/python3.5/dist-packages/conductr_cli/sandbox.py", line 10, in run
    main_handler.run(main_method)
  File "/usr/local/lib/python3.5/dist-packages/conductr_cli/main_handler.py", line 31, in run
    handler = logging.handlers.RotatingFileHandler(DEFAULT_ERROR_LOG_FILE, maxBytes=3000000, backupCount=1)
  File "/usr/lib/python3.5/logging/handlers.py", line 150, in __init__
    BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python3.5/logging/handlers.py", line 57, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python3.5/logging/__init__.py", line 1008, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python3.5/logging/__init__.py", line 1037, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
FileNotFoundError: [Errno 2] No such file or directory: '/home/shishir/.conductr/errors.log'

我正尝试在 Ubuntu Virtual Box 上 运行 它。这是 uname 输出:

shishir@shishir-VirtualBox:~$ uname -a
Linux shishir-VirtualBox 4.4.0-45-generic #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

我已经按照说明安装了 Docker 和 Python3。

我不确定是什么导致了这个问题,但指南中似乎缺少某些内容。任何解决此问题的帮助将不胜感激。

sandbox init 命令当前需要安装 docker-machine。在 Linux 上,情况并非如此。相反,使用原生 docker-engine。所以这是一个错误,因此 Linux 当前不支持 sandbox init 命令。 PR https://github.com/typesafehub/conductr-cli/pull/139 正在解决这个问题。合并 PR 后,所有操作系统都将支持 sandbox init 命令。

不过,您无需等到此问题得到解决。 sandbox init 命令仅检查您要 运行 ConductR 的 VM,在您的情况下 Ubuntu Virtual Box,是否有足够的资源来启动 ConductR。所有其他命令都在 Linux 上工作。我建议使用至少具有 4 个 CPU 和 4 GiB 内存的 VM。单独的 ConductR 不需要那么多资源,因此它在很大程度上取决于您想要在 ConductR 上 运行 什么以及您想要在 VM 中 运行 多少个 ConductR 实例。 ConductR 核心节点本身的最大堆设置为 256 MB 内存,ConductR 代理节点的最大堆设置为 128 MB 内存。

资源示例

  • 3 个 ConductR 核心节点:768 MB
  • 3 个 Conductr 代理节点:384 MB
  • ConductR 总计:1152 MB

因此,对于具有 4 GiB 的 VM,您几乎有 3 GiB 可用于您想要在 ConductR 上 运行 的服务,例如Lagom、Cassandra、Akka 和其他 Docker 张图片。