免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1503 | 回复: 1
打印 上一主题 下一主题

[FreeBSD] CFengine3 on FreeBSD [复制链接]

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-07-19 22:12 |只看该作者 |倒序浏览
本帖最后由 ulovko 于 2012-07-20 09:51 编辑

The joy of successfully getting a website to run on a bare install server was gone
when I had to do it for the twentieth time.
This is when I decided to get a Puppetmaster running for Twoppy.
Took me a week to automate the process of getting a Django server
and adding it to the loadbalancer, not a bad experience,
but since I’m an FreeBSD evangelist I heard
that CFengine is a faster, leaner tool to get servers running, especially FreeBSD.

When a new overhaul called CFengine3 came out,
along with the book Learning CFengine 3 there was nothing to stop me from trying it.
So I decided to setup CFengine so I can use it for our new project Invy.
Except that installing it on the Mac (with Homebrew) proofed to be a pain in the buttocks.
So, here is how to ignore the Mac and set it up on FreeBSD and start playing with CFengine3.

Installation from Ports
We are going to install CFengine3 from the ports, so make sure you have the latest ports available on your system.
You can check with:
  1. portsnap fetch update
复制代码
CFengine is located in the sysutils/cfengine3 directory. Install it as root:
  1. cd /usr/ports/sysutils/cfengine3
  2. make install clean
复制代码
I choose the default setup with Tokyo Cabinet. First we will need to create a private and public key pair:
  1. /usr/local/sbin/cf-key
复制代码
We have to copy the binaries to the CFengine directory, so CFEngine can find them. Not sure why this is needed, probably because CFengine wants to be able to verify them.
  1. cp /usr/local/sbin/cf-* /var/cfengine/bin/
复制代码
Our server expects the master files, meaning the main configuration files under the /var/cfengine/masterfiles/ directory. We need to copy the default files there:
  1. cp -Rp /usr/local/share/cfengine/CoreBase/ /var/cfengine/masterfiles
复制代码
The last step is bootstrapping CFengine, which copies the configuration files to their final working location and starts the daemon. For this you need to know the ip address, you can find this with ifconfig. With the ip address, run the following command:
  1. cf-agent --bootstrap --policy-server <your-ip-address>
复制代码
If everything went fine, you should be presented with Bootstrap to <your-ip-address> completed successfully. Final step is adding CFengine to your /etc/rc.conf, so that it starts on every boot.
  1. # Enable Cfengine 3
  2. cf_execd_enable="YES"
  3. cf_serverd_enable="YES"
复制代码
I completed the above installation on a FreeBSD virtual machine (with Parallels) and am now following along with the Learning CFengine 3 book. Hopefully I can present you with a Github repository that will setup a FreeBSD server for your web application anytime soon!



Learning-CFEngine3_Automated-System-Administraion-4-sites-of-Any-Size20120328.pdf:
Learning-CFEngine3_Automated-System-Administraion-4-sites-of-Any-Size20120328.pdf (4.43 MB, 下载次数: 19)

FROM: https://www.wunki.org/posts/2012-05-15-cfengine3-on-freebsd.html

论坛徽章:
0
2 [报告]
发表于 2012-07-28 11:09 |只看该作者
的确是一本好书
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP