Linux系统源码安装cloud-init
参考:https://cloud.tencent.com/document/product/213/12587
使用以下命令下载 cloud-init 源码包
官网下载地址:https://launchpad.net/cloud-init/+download
wget https://launchpad.net/cloud-init/trunk/17.1/+download/cloud-init-17.1.tar.gz
安装 cloud-init 依赖包
setuptools
jinja2
prettytable
oauthlib
configobj
pyyaml
requests
jsonpatch
jsonschema
six yum install python-pip -y
pip install setuptools jinja2 prettytable oauthlib pyyaml requests jsonpatch jsonschema six --upgrade
安装
tar -zxvf cloud-init-17.1.tar.gz
cd ./cloud-init-17.1
python setup.py build
python setup.py install --init-system systemd
其中,--init-system 的可选参数有:(systemd,sysvinit,sysvinit_deb,sysvinit_freebsd,sysvinit_openrc,sysvinit_suse,upstart);[default: None],需要根据当前操作系统使用的自启动服务管理方式是什么进行选择,如果选择出错则 cloud-init 服务无法开机自启动,本例以 systemd 自启动服务管理为例。
centos/redhat 6用的是sysvinit, 7系列用的是systemd, ubuntu用的是是upstart
添加 syslog 用户
useradd syslog
设置 cloud-init 服务开机自启动
systemctl enable cloud-init-local.service
systemctl start cloud-init-local.service
systemctl enable cloud-init.service
systemctl start cloud-init.service
systemctl enable cloud-config.service
systemctl start cloud-config.service
systemctl enable cloud-final.service
systemctl start cloud-final.service
systemctl status cloud-init-local.service
systemctl status cloud-init.service
systemctl status cloud-config.service
systemctl status cloud-final.service
CentOS 和 Red Hat 操作系统特殊执行:将/lib/systemd/system/cloud-init-local.service文件内容替换为如下:
[Unit]
Description=Initial cloud-init job (pre-networking)
Wants=network-pre.target
After=systemd-remount-fs.service
Before=NetworkManager.service
Before=network-pre.target
Before=shutdown.target
Conflicts=shutdown.target
RequiresMountsFor=/var/lib/cloud [Service]
Type=oneshot
ExecStart=/usr/bin/cloud-init init --local
ExecStart=/bin/touch /run/cloud-init/network-config-ready
RemainAfterExit=yes
TimeoutSec=0 # Output needs to appear in instance console output
StandardOutput=journal+console [Install]
WantedBy=cloud-init.target
将/lib/systemd/system/cloud-init.service文件内容替换为如下:
[Unit]
Description=Initial cloud-init job (metadata service crawler)
Wants=cloud-init-local.service
Wants=sshd-keygen.service
Wants=sshd.service
After=cloud-init-local.service
After=systemd-networkd-wait-online.service
After=networking.service
After=systemd-hostnamed.service
Before=network-online.target
Before=sshd-keygen.service
Before=sshd.service
Before=systemd-user-sessions.service
Conflicts=shutdown.target [Service]
Type=oneshot
ExecStart=/usr/bin/cloud-init init
RemainAfterExit=yes
TimeoutSec=0 # Output needs to appear in instance console output
StandardOutput=journal+console [Install]
WantedBy=cloud-init.target
Linux系统源码安装cloud-init的更多相关文章
- Linux系统源码安装过程中的prefix选项
在linux和unix环境中,源码安装是最常用的软件安装方式,一些软件除了提供源码外,也提供各种发行版的二进制安装包(如基于redhat包管理工具的rpm包),但强烈建议使用源码安装方式.原因是:(1 ...
- Linux系统源码安装软件过程中configure选项-prefix的作用
在linux和unix环境中,源码安装是最常用的软件安装方式,一些软件出了提供源码外,也提供各种发行版的二进制安装包(如基于redhat包管理工具的rpm包),但强烈建议使用源码安装方式. 在linu ...
- linux 手动源码安装lnmp(亲测)
linux 手动源码安装lnmp笔记(亲测)<pre>先安装这2个yum install gccyum install g++</pre><pre>先在linux ...
- Linux中源码安装编译Vim
Linux中源码安装编译Vim Linux下学习工作少不了编辑器,Vim能使你的工作效率成倍的提高.在Ubuntu上安装vim使用命令直接安装很简单.但有时还是需要自己手动编译安装.例如: vim中的 ...
- linux下源码安装netcat
linux下源码安装netcat http://blog.chinaunix.net/uid-20783755-id-4211230.html 1,下载netcat源码,netcat-0.7.1-13 ...
- CentOS7(Linux)源码安装Redis
介绍 项目中经常需要用到Redis做缓存数据库,可是还有小伙伴不会在Linux上安装Redis,毕竟我们开发的项目都是要在服务器上运行的,今天就来讲讲如何在CentOS7环境使用源码进行安装Redis ...
- CentOS7(Linux)源码安装MySQL5.7.X
介绍 软件应用最重要的就是数据库了,可是还有小伙伴不会在Linux上安装MySQL数据库,今天就来讲讲如何在CentOS7环境使用源码进行安装MySQL5.7.X. MySQL官网下载链接:https ...
- Linux下源码安装方式安装MySQL
1.下载安装包:https://downloads.mysql.com/archives/community/ 2.安装开发工具和安装包 因为要把源码编译成二进制数据,所以必须要有编译器和解释器 g ...
- linux(centos)源码安装git
最近使用一个开源库,部署的的时候需要用git克隆依赖库.刚好系统没安装git.就尝试了源码安装git. 源码下载地址:http://codemonkey.org.uk/projects/git-sna ...
随机推荐
- 数集合有多少个TOJ(2469)
题目链接:http://acm.tju.edu.cn/toj/showp2469.html 感觉这个题目有点问题,算了不管他了,反正A了. 这里要注意的是求这个集合有多少种,那么就是要剔除重复数后,再 ...
- 2018.7.26 进程和线程的区别 &&你对 Java平台的理解
进程和线程的区别 1.定义 进程:具有一定独立功能的程序关于某个数据集合上的一次运行活动,进程是系统进行资源分配和调度的一个独立单位. 线程:进程的一个实体,是CPU调度和分派的基本单位,它是比进程更 ...
- 2017.11.18 C语言的算法分析题目
算法分析 1. 选定实验题目,仔细阅读实验要求,设计好输入输出,按照分治法的思想构思算法,选取合适的存储结构实现应用的操作. 2. 设计的结果应在Visual C++ 实验环境下实现并进行调试.(也可 ...
- 2017.10.20 jsp用户登陆界面连接数据库
用户登陆界面 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8 ...
- Thread 创建线程
1.该线程变量 无参数 我们可以把线程的变量 理解为一个 委托.可以指向一个方法.有点像c语言中的指向函数的指针. 第1步我们创建了 Thread变量t1 ,第2步创建了一个方法threadChild ...
- material(一)
项目目录如下 逻辑代码 import React from 'react'; import PropTypes from 'prop-types'; import Button from '@mate ...
- c#简单加密和对称加密
转自:https://www.cnblogs.com/zhihai/archive/2012/05/03/2480856.html using System;using System.Collecti ...
- jquery 筛选元素(1)
.eq() 减少匹配元素的集合为指定的索引的那一个元素. .eq(index) index一个整数,指示元素的位置,以0为基数. $("li").eq(2).css('backgr ...
- JavaScript中并非一切皆对象
对象是js中的基础以及核心,在js中有六种主要类型:string number boolean null undefined object 除了oject类型以为其他五种本身并非对象,null本身 ...
- 51nod 1298 圆与三角形——计算几何
题目链接:http://www.51nod.com/Challenge/Problem.html#!#problemId=1298 转化成判断三条线段和圆是否