AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-1089817

Laxman Singh Rajpurohit's questions

Martin Hope
Laxman Singh Rajpurohit
Asked: 2020-06-02 08:06:36 +0800 CST

ec2 ubuntu 服务器 18.04 上的 Cloud-init 相关错误

  • 0

我的 EC2 Ubuntu 18.04 服务器出现以下错误。如果有人知道原因和解决方案,请帮助我。

当我尝试时,Cloud-init status我得到status: error了结果。

下面显示的错误日志来自/var/log/cloud-init-output.log:

Cloud-init v. 19.4-33-gbb4131a2-0ubuntu1~18.04.1 running 'init-local' at Fri, 01 May 2020 13:12:14 +0000. Up 8.38 seconds.
2020-05-01 13:12:14,988 - util.py[WARNING]: failed stage init-local
failed run of stage init-local
------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 653, in status_wrapper
ret = functor(name, args)
File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 323, in main_init
init.fetch(existing=existing)
File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 352, in fetch
return self._get_data_source(existing=existing)
File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 253, in _get_data_source
util.del_file(self.paths.instance_link)
File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 1793, in del_file
raise e
File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 1790, in del_file
os.unlink(path)
IsADirectoryError: [Errno 21] Is a directory: '/var/lib/cloud/instance'
------------------------------------------------------------
Cloud-init v. 19.4-33-gbb4131a2-0ubuntu1~18.04.1 running 'init-local' at Fri, 01 May 2020 18:10:43 +0000. Up 8.08 seconds.
2020-05-01 18:10:43,999 - util.py[WARNING]: failed stage init-local
failed run of stage init-local
------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 653, in status_wrapper
ret = functor(name, args)
File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 323, in main_init
init.fetch(existing=existing)
File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 352, in fetch
return self._get_data_source(existing=existing)
File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 253, in _get_data_source
util.del_file(self.paths.instance_link)
File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 1793, in del_file
raise e
File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 1790, in del_file
os.unlink(path)
IsADirectoryError: [Errno 21] Is a directory: '/var/lib/cloud/instance'

目前,服务器正在运行。

ubuntu@host:~$ sudo cat /etc/netplan/*.yaml

# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}

network:
    ethernets:
        eth0:
            dhcp4: true
            match:
                macaddress: 02:9e:ef:ad:39:1a
            set-name: eth0
    version: 2

ubuntu@host:~$ ls -lah /etc/netplan/
total 20K
drwxr-xr-x   2 root root 4.0K May 18 04:10 .
drwxr-xr-x 117 root root  12K Jun  2 06:32 ..
-rw-r--r--   1 root root  481 Jun  1 09:51 50-cloud-init.yaml

ubuntu@host:~$ sudo lshw -C network
  *-network                 
       description: Ethernet interface
       physical id: 1
       logical name: eth0
       serial: 02:9e:ef:ad:39:1a
       capabilities: ethernet physical
       configuration: broadcast=yes driver=vif ip=172.31.1.160 link=yes multicast=yes

=========我在其他服务器上做的解决方案如下所示============

ref. link = https://cloudinit.readthedocs.io/en/latest/topics/faq.html

$ sudo DI_LOG=stderr /usr/lib/cloud-init/ds-identify --force
$ sudo cloud-init clean --logs
$ sudo cloud-init init --local
$ sudo cloud-init init

@heynnema Below  the output of cat /etc/netplan/*.yaml

root@ip-172-31-1-135:/# cat /etc/netplan/*.yaml
# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
        ens5:
            dhcp4: true
            match:
                macaddress: 02:69:72:f4:1e:aa
            set-name: ens5
    version: 2
server python amazon-ec2
  • 1 个回答
  • 3108 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve