centos6系列问题
一、NetworkManager启动问题
1、由于以后要支持e1000版虚拟化网卡,所有centos6镜像均按照NetworkManager服务,并设置开机自启动
2、虚机启动时,默认是NetworkManager服务先启动,后续启动cloud-init,但是NetworkManager启动过程中还未设置好网关,cloud-init就从169.254.169.254获取meta-data,导致获取元数据失败,继而不再重新获取
Mounting local filesystems: [ OK ]
Enabling /etc/fstab swaps: [ OK ]
Entering non-interactive startup
Bringing up loopback interface: [ OK ]
Bringing up interface eth0:
Determining IP information for eth0... done.
[ OK ]
Starting auditd: [ OK ]
Starting system logger: [ OK ]
Starting system message bus: [ OK ]
Mounting filesystems: [ OK ]
Starting acpi daemon: [ OK ]
Retrigger failed udev events[ OK ]
Starting cloud-init: Cloud-init v. 0.7.5 running 'init-local' at Thu, 19 Oct 2017 07:50:01 +0000. Up 25.44 seconds.
Setting network parameters... [ OK ]
Starting NetworkManager daemon: [ OK ]
Starting cloud-init: Cloud-init v. 0.7.5 running 'init' at Thu, 19 Oct 2017 07:50:02 +0000. Up 26.01 seconds.
ci-info: ++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++
ci-info: +--------+------+--------------+---------------+-------------------+
ci-info: | Device | Up | Address | Mask | Hw-Address |
ci-info: +--------+------+--------------+---------------+-------------------+
ci-info: | lo | True | 127.0.0.1 | 255.0.0.0 | . |
ci-info: | eth0 | True | 9.111.222.12 | 255.255.255.0 | fa:16:3e:f3:41:85 |
ci-info: +--------+------+--------------+---------------+-------------------+
ci-info: +++++++++++++++++++++++++++++Route info++++++++++++++++++++++++++++++
ci-info: +-------+-------------+---------+---------------+-----------+-------+
ci-info: | Route | Destination | Gateway | Genmask | Interface | Flags |
ci-info: +-------+-------------+---------+---------------+-----------+-------+
ci-info: | 0 | 9.111.222.0 | 0.0.0.0 | 255.255.255.0 | eth0 | U |
ci-info: +-------+-------------+---------+---------------+-----------+-------+
2017-10-19 15:50:02,546 - util.py[WARNING]: No instance datasource found! Likely bad things to come!
Starting cloud-init: Can not apply stage config, no datasource found! Likely bad things to come!
------------------------------------------------------------
Traceback (most recent call last):
File "/usr/bin/cloud-init", line 318, in main_modules
init.fetch()
File "/usr/lib/python2.6/site-packages/cloudinit/stages.py", line 308, in fetch
return self._get_data_source()
File "/usr/lib/python2.6/site-packages/cloudinit/stages.py", line 236, in _get_data_source
pkg_list)
File "/usr/lib/python2.6/site-packages/cloudinit/sources/__init__.py", line 260, in find_source
raise DataSourceNotFoundException(msg)
DataSourceNotFoundException: Did not find any data source, searched classes: ()
------------------------------------------------------------
Starting cloud-init: Can not apply stage final, no datasource found! Likely bad things to come!
------------------------------------------------------------
Traceback (most recent call last):
File "/usr/bin/cloud-init", line 318, in main_modules
init.fetch()
File "/usr/lib/python2.6/site-packages/cloudinit/stages.py", line 308, in fetch
return self._get_data_source()
File "/usr/lib/python2.6/site-packages/cloudinit/stages.py", line 236, in _get_data_source
pkg_list)
File "/usr/lib/python2.6/site-packages/cloudinit/sources/__init__.py", line 260, in find_source
raise DataSourceNotFoundException(msg)
DataSourceNotFoundException: Did not find any data source, searched classes: ()
------------------------------------------------------------
Starting sshd: [ OK ]
NTP server not specified in /etc/ntp/step-tickers or /etc/ntp.conf
Starting crond: [ OK ]
Cloud-init v. 0.7.5 running 'init' at Thu, 19 Oct 2017 07:50:06 +0000. Up 30.44 seconds.
console输出的启动日志
3、临时解决办法:cloud-init只获取一次meta-data,如果拿到就执行cloud-init final阶段,如果获取失败则报错,不再重新获取。
需要手动执行命令:cloud-init init 重新加载元数据。见官方释义:
your 'cloud-init modules --mode init' is a bad command. it shouldnt fail like that, but its not normally called like that.
I think what might be wrong is that you're not getting the systemd files, and your boot just isn't fully working. proper cloud-init boot consists of:
1.) cloud-init init --local
when root filesystem is mounted (not network guaranteed or expected)
2.) cloud-init init
when root filesystem is mounted and expected networking is up
3.) cloud-init modules --mode=config
4.) cloud-init modules --mode=final if [ $(nm-tool|grep State|cut -f2 -d' ') == "connected" ]; then
#Whatever you want to do if the network is online
else
#Whatever you want to do if the network is offline - note, this and the else above are optional
fi
官方说明
以下是重新请求meta-data过程,此时的网关已配置好。
ci-info: ++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++
ci-info: +--------+------+--------------+---------------+-------------------+
ci-info: | Device | Up | Address | Mask | Hw-Address |
ci-info: +--------+------+--------------+---------------+-------------------+
ci-info: | lo | True | 127.0.0.1 | 255.0.0.0 | . |
ci-info: | eth0 | True | 9.111.222.12 | 255.255.255.0 | fa:16:3e:f3:41:85 |
ci-info: +--------+------+--------------+---------------+-------------------+
ci-info: ++++++++++++++++++++++++++++++++++Route info+++++++++++++++++++++++++++++++++++
ci-info: +-------+-----------------+-------------+-----------------+-----------+-------+
ci-info: | Route | Destination | Gateway | Genmask | Interface | Flags |
ci-info: +-------+-----------------+-------------+-----------------+-----------+-------+
ci-info: | 0 | 169.254.169.254 | 9.111.222.1 | 255.255.255.255 | eth0 | UGH |
ci-info: | 1 | 9.111.222.0 | 0.0.0.0 | 255.255.255.0 | eth0 | U |
ci-info: | 2 | 0.0.0.0 | 9.111.222.1 | 0.0.0.0 | eth0 | UG |
ci-info: +-------+-----------------+-------------+-----------------+-----------+-------+
Cloud-init v. 0.7.5 running 'modules:final' at Thu, 19 Oct 2017 07:50:09 +0000. Up 32.83 seconds.
ci-info: no authorized ssh keys fingerprints found for user centos.
ci-info: no authorized ssh keys fingerprints found for user centos.
ec2:
ec2: #############################################################
ec2: -----BEGIN SSH HOST KEY FINGERPRINTS-----
ec2: 1024 64:51:25:60:d0:dd:b8:4e:7d:44:48:26:10:f9:45:f9 /etc/ssh/ssh_host_dsa_key.pub (DSA)
ec2: 2048 16:59:08:50:37:c3:00:ef:99:95:3f:a3:77:fa:93:a4 /etc/ssh/ssh_host_key.pub (RSA1)
ec2: 2048 a5:6a:dd:74:ca:16:8e:31:bf:b3:4b:0a:c2:00:8a:42 /etc/ssh/ssh_host_rsa_key.pub (RSA)
ec2: -----END SSH HOST KEY FINGERPRINTS-----
ec2: #############################################################
-----BEGIN SSH HOST KEY KEYS-----
2048 35 27541365050360239591435118454881578709989698650445165117194575889698589475215223627758158702900045160955947733502097866541192556859221451348995793597455183479757238929837171679731292857649919286872697745243345043316525076401529065475241084237855394096516334565000392633100535646579890169878467508388499646801050965943901526178822341472627146211336179874861157576903803503129246774552668615235335787440894750828817448110386642500635061170389250028325735639078142790135990986654283910570646473566300407984700279749726680206710460528663881338239437387901739932914387009958132186216400741136674654292094798863513309928467
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvE3cSVF2vqXcGe+1yuhKx2ZiAP2QKNgzgSRiCpm2MIzIirxnIPmGhgNRSo/GiJfNrw3Pk//i3rNYPAvvC9xs0MDeXGPqcxKemOUYzdmfX3BvdUMVi4nst+oAj3wBGeqEdFMXy5qTvh2zJbTvYDJ4CY8GpPO/WFjV/WqFeaquP6nIbn51rcJMbusj4dLITkXR+/YS+m5xfKI68y7E16HzqWZhDL72orYUZKlkC4BAsY1ySgd+mDslWVnQ6qZcK8cHiIqMHGBI0GlTRil1tg5DBfvXzxtOh0w91pJNvSO9u+XGnzvEy9tTR1Asw/8qecKloCFWnDh4ZFOAdnFVVy171w==
-----END SSH HOST KEY KEYS-----
Cloud-init v. 0.7.5 finished at Thu, 19 Oct 2017 07:50:09 +0000. Datasource DataSourceOpenStack [net,ver=2]. Up 33.31 seconds CentOS release 6.5 (Final)
Kernel 2.6.32-431.el6.x86_64 on an x86_64 boot6-5 login:
cloud-init重新加载meta-data过程
4、根本解决办法:
v1、rc.local运行命令重新加载
v2、修改cloud.cfg,增加超时和重试参数
datasource:
OpenStack:
metadata_urls: ["http://169.254.169.254"]
max_wait: 120
timeout: 10
retries: 5
centos6系列问题的更多相关文章
- centos6系列更换阿里yum源
1.首先备份原来的cent os官方yum源 cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak 2. ...
- CentOS6系列系统启动常见故障排查与解决方法
情景一.内核文件损坏 /boot/vmlinuz-2.6.32-642.el6.x86_64 内核文件 1.故障现象 2.解决方法:挂载光盘,进入rescue(救援)模式 3.选择--English- ...
- Centos6系列Bond配置方法
在Windows Server平台因业务需求经常会用到NIC双网卡绑定,同样Linux平台下用于网络负载均衡及网络冗余会用到bond模式. Bond模式:0-6,即7种模式. 模式一:mod=0 ,即 ...
- Centos6系列安装nginx
设置ssh服务为开机启动 输入命令:chkconfig sshd on 即可.注:若是chkconfig sshd off则禁止SSH开机启动 设定账号为bizuser ,密码为123456 第一步: ...
- 在centos6系列vps装Tomcat8.0
In the following tutorial you will learn how to install and set-up Apache Tomcat 8 on your CentOS 6 ...
- centos6.7 安装Docker
一.查看系统版本 [root@localhost ~]# cat /etc/redhat-release CentOS release 6.7 (Final) 二.安装EPEL 1.进入cento ...
- CentOS6 启动流程图文解剖
我们在使用Linux操作系统的时候,我们只需按下电源键,等待,然后输入账户和密码就可以使用Linux操作系统了.那么在按下电源到输入账号和密码之前,操作系统都做了些什么?下面就来讲述在这段时间发生的动 ...
- CentOS6.9安装mysql5.7
1.查看系统版本 uname -a 2.卸载old mysql rpm -qa|grep -i mysql rpm -ev MySQL-client-5.5.25a-1.rhel5 如果提示依赖错误, ...
- centos6安装部署git服务器(gitlab6.4)
环境准备 python版本2.6git版本 1.8.4.1ruby版本ruby-2.0.0-p353gitlab-shell版本 v1.8.0gitlab版本6.4.3 因centos6系列的pyth ...
随机推荐
- Linux(三) - 文件操作相关命令
Ctl-A 光标移动到行首 Ctl-C 终止命令 Ctl-D 注销登录 Ctl-E 光标移动到行尾 Ctl-U 删除光标到行首的所有字符,在某些设置下,删除全行 Ctl-W 删除当前光标到前边的最近一 ...
- Linux(二) - Unix&Linux 基本概念
主机 = 内核 + 实用工具 内核(kernel) 当计算机启动时,计算机要经历一系列动作,这些动作构成了引导过程.引导过程的最后一个动作是启动一个非常复杂的程序,该程序就被称为内核(Kernel) ...
- material(一)
项目目录如下 逻辑代码 import React from 'react'; import PropTypes from 'prop-types'; import Button from '@mate ...
- redis事务中的WATCH命令和基于CAS的乐观锁
转自:http://blog.sina.com.cn/s/blog_ae8441630101cgy3.html 在Redis的事务中,WATCH命令可用于提供CAS(check-and-set)功能. ...
- windows安装配置mongodb及图形工具MongoVUE
解压安装包到D:\Program Files\mongodb 建立数据库目录 D:\Program Files\mongodb\data 建立日志目录 D:\Program Files\mongodb ...
- 插入数据返回自增id及插入更新二合一
原文https://blog.csdn.net/dumzp13/article/details/50984413 JDBC: con.setAutoCommit(false); String sql ...
- C++二维数组动态申请内存
好久没用C++刷题了,今天早上刷了几条题,感觉很陌生了.怪我,大二下实在太颓废了,没啥作为. 今天更新个关于c++二维数组内存申请的问题,当初作为菜鸟初学指针的时候,还是在这方面有点搞不通的.今天用到 ...
- LeetCode804. Unique Morse Code Words
题目 国际摩尔斯密码定义一种标准编码方式,将每个字母对应于一个由一系列点和短线组成的字符串, 比如: "a" 对应 ".-", "b" 对应 ...
- 如何在RedHat 7.0系统中安装mysql 5.7.22
如何在RedHat 7.0系统中安装mysql 5.7.22 今天给大家介绍一下如何安装mysql5.7,在安装之前,首先要查看的是,你的系统中有没有已经安装过的情况.键入rpm -qa|grep m ...
- mysql 命令 小结
CREATE DATABASE IF NOT EXISTS yourdbname DEFAULT CHARSET utf8 COLLATE utf8_general_ci;创建中文数据库show gl ...