为了保证使用备份恢复的新云服务器可以自定义配置(例如修改云服务器密码),请在恢复完成后安装Cloud-Init工具。
安装Cloud-Init相关操作请参考:安装Cloud-init。
配置Cloud-Init相关操作请参考:配置Cloud-init。
本节列出了安装Cloud-Init的常见问题及解决方法。
安装Cloud-Init后,执行以下命令设置Cloud-Init为开机自启动时提示失败:
systemctl enable cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
回显信息如下所示:
systemctl unmask cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
systemctl enable cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
systemctl status cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
回显信息如下所示,提示failed且所有的服务状态都是inactive。
原因是系统查询Cloud-Init的地址指向/usr/bin/,但是实际安装路径指定的是/usr/local/bin,因此出现了上述错误。
# systemctl restart cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
systemctl status cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
# apt-get update
# apt-get install sysv-rc-conf
# cp /usr/sbin/sysv-rc-conf /usr/sbin/chkconfig
安装完成后,执行以下命令查看版本号。
cloud-init -v
如果回显信息如下所示:
-bash:/usr/bin/cloud-init:not found this command
解决方法:执行以下命令将cloud-init 复制至usr/bin目录下。
# cp /usr/local/bin/cloud-init /usr/bin/
回显信息如下所示:
-bash:/usr/bin/cloud-init:not found this command
解决方法:执行命令 # cp /usr/local/bin/cloud-init /usr/bin/将cloud-init 复制至usr/bin目录下
回显信息如下所示:
原因分析:未安装gcc导致无法编译。
解决方法:
执行以下命令安装gcc后重新安装Cloud-Init
yum -y install gcc
systemctl enable cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
回显信息提示如下所示:
解决方法:
# systemctl unmask cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
# systemctl enable cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
# systemctl restart cloud-init-local.service cloud-init.service cloud-config.service cloud-final.service
然后执行命令systemctl status查看服务状态。回显信息如下所示:
cloud-init init --local
回显信息出现以下警告:
/usr/lib/python2.5/site-packages/Cheetah/Compiler.py:1532: UserWarning: You don‘t have the C version of NameMapper installed! I‘m disabling Cheetah‘s useStackFrames option as it is painfully slow with the Python version of NameMapper. You should get a copy of Cheetah with the compiled C version of NameMapper. "\nYou don‘t have the C version of NameMapper installed!
出现该警告是因为在安装Cloud-Init时,需要编译c版本的NameMapper,但是该系统没有预装gcc,因此无法编译,这才导致c版本的NameMapper缺失。
yum -y install gcc
然后再重新安装Cloud-Init
域名 必须要实名才能用吗?也不是,目前,在我国 注册域名 ,有少部分域名还不能...
本文转载自微信公众号「Piper蛋窝」,作者Piper蛋。转载本文请联系Piper蛋窝公众...
真正的智慧城市是建立在自由开放的数据交换基础之上的,由企业提供并通过物联网...
【51CTO.com快译】边缘计算对于更广泛的云计算和基础设施服务市场意味着什么?很...
怎么联系 域名 持有者?当查询域名时,发现心仪的域名已被注册,依然想购买此域...
TOP云 (west.cn)2月4日讯,纵观整个米圈投资市场,.xyz、.top、.wang等许多新顶...
1. 接口描述 接口请求域名: as.tencentcloudapi.com 。 本接口(DeleteNotifica...
刚刚,区域全面经济伙伴关系协定(RCEP)正式签署! 据央视新闻,第四次区域全面...
http://www.zuntop.com 随着国家对战略性新兴产业的重视,对云计算、下一代信息...
TOP云 12月18日消息,据业内人士透露,国内知名浏览器公司傲游重金从国外收购了 ...