多语言展示
当前在线:1965今日阅读:167今日分享:16

ubuntu14.04安装chef

Chef 是一款自动化服务器配置管理工具,可以对所管理的对象实行自动化配置,如系统管理,安装软件等。Chef 由三大组件组成:Chef Server、Chef Workstation 和 Chef Node。Chef Server 是核心服务器,维护了一套配置脚本(Cookbook),与每个被管节点(Chef Node)交互并给出配置指令。Chef Workstation 提供了我们与 Chef Server 交互的接口:我们在 Workstation 上创建定义 Cookbook,并将 Cookbook 上传到 Chef Server 上以保证被管机器能从 Chef Server 上取得最新的配置指令。Chef Node 是安装了 chef-client 并注册了的被管理节点,可以是物理机或者虚拟机或者其他对象。Chef Node 每次运行 chef-client 时都会从 Chef Server 端取得最新的配置指令(Cookbook)并按照指令配置自己。
工具/原料

ubuntu14.04服务器

方法/步骤
1

Chef 环境的安装步骤一般是:先安装 Chef Server,然后配置 Chef Workstation, 最后根据需要在客户端机器上安装 Chef Client 并将其注册成 Chef Node。Chef Server 和 Chef Workstation 可以配在一台机器上,也可以分开配置。由 Chef Server、Chef Workstation 和多个 Chef Node 组成整个 Chef 环境。 所以我们这里就选择使用三台虚拟服务器。192.168.2.63192.168.2.64192.168.2.65

2

更新源:我这里选择的是阿里云的源deb http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse

3

更新源后一定要升级,让新的源生效:# apt-get update

4

到这里基本上准备工作就差不多了,然后我们就可以开始安装一些所需要的组件,安装NTP时间服务器,Chef需要确保workstation与所有client与server的时钟一致。

5

修改NTP配置文件,当然这里不修改使用默认的也是一样的:vi /etc/ntp.confserver chef-server iburst

6

这里我们首先安装chef-server,在ubuntu14.04上直接安装chef就可以。# apt-get install chef

7

在安装的过程中会弹出一个交互界面,需要填写上你的chef访问的路径。当然还有密码,但是我操作的过程中没有弹出输入密码框就直接安装完成。

注意事项

网络上Ubuntu安装chef的文档比较少,我这里的安装也是第一次做,是否正确还有待商榷。

推荐信息