【问题标题】:Minishift cannot start in macOSMinishift 无法在 macOS 中启动
【发布时间】:2021-08-05 04:26:12
【问题描述】:

一般信息

Minishift 版本:v1.34.3+4b58f89

操作系统:macOS

管理程序:hyperkit

复制步骤

minishift start --show-libmachine-logs -v 5

预期

minishift 成功启动。

实际

启动 VM 时出错:启动停止主机时出错:在 dhcp 租约文件中找不到 IP 地址临时错误:找不到生成的 MAC 的 IP 地址

日志

-- minishift version: v1.34.3+4b58f89
-- Starting profile 'minishift'
Found binary path at /usr/local/bin/docker-machine-driver-hyperkit
Launching plugin server for driver hyperkit
Plugin server listening at address 127.0.0.1:50805
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(minishift) Calling .GetState
-- Check if deprecated options are used ... OK
-- Checking if https://github.com is reachable ... OK
-- Checking if requested OpenShift version 'v3.11.0' is valid ... OK
-- Checking if requested OpenShift version 'v3.11.0' is supported ... OK
-- Checking if requested hypervisor 'hyperkit' is supported on this platform ... OK
-- Checking if hyperkit is installed ... 
   Hyperkit is available at /usr/local/bin/hyperkit
   Checking for setuid bit ... OK
-- Checking if hyperkit driver is installed ... 
   Driver is available at /usr/local/bin/docker-machine-driver-hyperkit
   Checking for setuid bit ... OK
-- Checking the ISO URL ... OK
-- Checking if provided oc flags are supported ... OK
-- Starting the OpenShift cluster using 'hyperkit' hypervisor ...
-- Starting Minishift VM ....Found binary path at /usr/local/bin/docker-machine-driver-hyperkit
Launching plugin server for driver hyperkit
Plugin server listening at address 127.0.0.1:50813
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(minishift) Calling .GetState
(minishift) Calling .Start
(minishift) Using UUID 91b2bdde-f54b-11eb-b552-1c36bb1ab9e0
(minishift) Generated MAC 56:bb:6a:61:3c:34
(minishift) Starting with cmdline: 
...................... FAIL E0804 23:28:48.938399    8469 start.go:499] Error starting the VM: Error starting stopped host: IP address never found in dhcp leases file Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34. Retrying.
Error starting the VM: Error starting stopped host: IP address never found in dhcp leases file Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34
Temporary Error: Could not find an IP address for 56:bb:6a:61:3c:34

【问题讨论】:

    标签: macos networking openshift minishift


    【解决方案1】:

    试试这个:

    sudo vi /var/db/dhcpd_leases
    

    添加这个

    {
        name=minishfit
        ip_address=192.168.64.3
        hw_address=1,56:bb:6a:61:3c:34
        identifier=1,56:bb:6a:61:3c:34
        lease=0x5e41592a
    }
    

    然后minishift开始

    如果您看到这样的超时错误:

    Error starting the VM: Error configuring authorization on host: Too many retries waiting for SSH to be available.  Last error: Maximum number of retries (60) exceeded.
    

    试试这个:

    minishift delete --force --clear-cache
    
    minishift start
    

    【讨论】:

    • ip和硬件地址从哪里来?我必须让它们适应我的系统吗?
    • 另外,“name=minishfit”有拼写错误。 (如果这很重要?)
    • 这是一个 DHCP 租约,只要确保 IP 地址没有被使用。名称可任意命名,方便识别
    【解决方案2】:

    Openshift Cluster 现在是 4.7 版,我强烈建议您使用 CRC(代码就绪容器)来代替 Minishift。 您可以在这里下载免费版本:https://www.okd.io/crc.html

    【讨论】:

    • CRC 至少需要 9GB 内存。有什么方法可以在 8GB RAM 的机器上运行 CRC?
    • 要使用的命令是:crc config set memory XX,但你是对的,最小值是 9216 (9GB)。作为替代方案,您可以尝试 Docker Desktop for Mac,也可以配置 Kubernetes 集群。
    【解决方案3】:

    Minishift 不仅已被弃用,而且在 Mac OSX Monterey 上安装也会出现问题。即使它安装成功,各种东西都坏了:

    $ sudo du -hx -d2 '/'* 2>/dev/null | grep -ve $'M\t' -e $'K\t' -e $'B\t' | sort -k 2 ; echo Finished
    # ONLY DELETE NON-ESSENTIAL FILES IN YOUR HOME DIRECTORY
    $ softwareupdate --all --install --force
    Downloaded macOS 10.14.6 Update
    Installing macOS 10.14.6 Update
    $ sudo reboot
    # Note you may need to run softwareupdate several times depending on how outdated your computer is
    # In fact, I would keep updating until you get the latest MacOSX version, which at the time of this writing is macOS Monterery
    # Once your system is up-to-date, then install Docker Desktop: https://docs.docker.com/desktop/mac/install/
    # Note if you are using the latest version of OSX and the latest version of Docker Desktop, then it will install and launch smoothly.
    % which docker
    /usr/local/bin/docker
    # Now run “brew update && brew upgrade” or install homebrew if not installed:
    % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    ==> This script will install:
    /usr/local/bin/brew
    /usr/local/share/doc/homebrew
    /usr/local/share/man/man1/brew.1
    /usr/local/share/zsh/site-functions/_brew
    /usr/local/etc/bash_completion.d/brew
    /usr/local/Homebrew
    ==> The following new directories will be created:
    /usr/local/Cellar
    /usr/local/Caskroom
    ==> The Xcode Command Line Tools will be installed.
    # Use the hyperkit virtual machine. docker-machine-driver-xhyve is deprecated!
    % brew install hyperkit
    % brew install docker-machine-driver-hyperkit
    % sudo chown root:wheel /usr/local/opt/docker-machine-driver-hyperkit/bin/docker-machine-driver-hyperkit
    % sudo chmod u+s /usr/local/opt/docker-machine-driver-hyperkit/bin/docker-machine-driver-hyperkit
    # THERE IS A HUGE BUG HERE. Basically, the setuid is correctly added to /usr/local/opt/docker-machine-driver-hyperkit/bin/docker-machine-driver-hyperkit BUT NOT the symlink at /usr/local/bin/docker-machine-driver-hyperkit. Consequently, I had to delete the symlink at /usr/local/bin/docker-machine-driver-hyperkit and then create a hard link to /usr/local/bin/docker-machine-driver-hyperkit and then add the setuid and change ownership there!
    % ls -l /usr/local/bin/docker-machine-driver-hyperkit
    -r-sr-xr-x  2 root  wheel  11581712 Mar  1  2018 /usr/local/bin/docker-machine-driver-hyperkit
    % brew install cask
    % brew install --cask minishift
    % which minishift
    /usr/local/bin/minishift
    % sudo vi /var/db/dhcpd_leases
    {
        name=minishfit
        ip_address=192.168.64.3
        hw_address=1,56:bb:6a:61:3c:34
        identifier=1,56:bb:6a:61:3c:34
        lease=0x5e41592a
    }
    % minishift start
    

    您应该使用 RedHat CodeReady Containers,而不是使用 Minishift。 Mac OSX 的说明在这里(注意您的机器上必须有 35gb 的可用磁盘空间):

    https://access.redhat.com/documentation/en-us/red_hat_codeready_containers/1.0/html/getting_started_guide/getting-started-with-codeready-containers_gsg

    minishift 需要 5 个小时,而 CRC 只需要 5 分钟。

    【讨论】:

      【解决方案4】:

      就我而言,我运行了公司的防病毒软件(尤其是启用了 防火墙 的 McAfee),这阻止了 dhcpd_leases 的创建。关闭它并暂时关闭防火墙后,它得到了修复。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-12-12
        • 2017-12-02
        • 1970-01-01
        • 1970-01-01
        • 2017-03-29
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多