cloudify学习小结

来源:互联网 发布:mac系统连接电视hdmi 编辑:程序博客网 时间:2024/05/20 11:49

参考:http://docs.getcloudify.org/3.4.0/installation/from-packages/
http://docs.getcloudify.org/3.4.0/manager/bootstrapping/

cloudify是一个开源的paas应用编排和管理的系统
它采用面向插件的架构
它的cli为cfy,gui为cloudify manageer,此外,它也提供restful api供开发人员调用

一般在开发环境,我们可以在一台VM或物理机上部署cloudify manager。但在测试和生产环境我们需要利用cloudify的openstack或aws plugin与IAAS层资源集成起来,这样的话
组件是在VM中部署的。而现如今paas的应用一般部署在容器中,我们可以利用cloudify的docker plugin与docker集成起来。

在一台VM或物理机中部署cloudify manager
1) 安装cfy cli
在http://getcloudify.org/downloads/get_cloudify_3x.html下载对应的package(centos的rpm,ubuntu的deb,windows的exe,我的是在centos7.2上部署)

$ sudo rpm -i cloudify-3.4.1~sp-410.el6.x86_64.rpm

2) 初始化工作目录

$ cd ~$ mkdir cloudify-use$ cd cloudify-use$ cfy init

执行完后,会发现.cloudify目录,可以在该目录下的config.yaml中配置color,log的级别

3) 准备启动cloudify manager的系统组件

cloudify是通过blueprint这个文件结构来管理所有程序的,包括它的系统组件也是通过该方式启动的

一般而言,装完cfy后,在/opt/cfy/cloudify-manager-blueprints下会有cloudify manager 系统组件的blueprint,如果没有,则手动下载

$ curl -L https://github.com/cloudify-cosmo/cloudify-manager-blueprints/archive/3.4.tar.gz -o cloudify-manager-blueprints.tar.gz$ tar -xzvf cloudify-manager-blueprints.tar.gz$ cd cloudify-manager-blueprints-3.4$ ls -l...-rw-r--r--  aws-ec2-manager-blueprint-inputs.yaml-rw-r--r--  aws-ec2-manager-blueprint.yaml-rw-r--r--  openstack-manager-blueprint-inputs.yaml-rw-r--r--  openstack-manager-blueprint.yaml-rw-r--r--  simple-manager-blueprint-inputs.yaml-rw-r--r--  simple-manager-blueprint.yaml-rw-r--r--  vcloud-manager-blueprint-inputs.yaml-rw-r--r--  vcloud-manager-blueprint.yaml-rw-r--r--  vsphere-manager-blueprint-inputs.yaml-rw-r--r--  vsphere-manager-blueprint.yaml...

因为我采用单台机器安装cloudify,因此使用simple-manager-blueprint.yaml和simple-manager-blueprint-inputs.yaml两个文件
修改配置文件simple-manager-blueprint-inputs.yaml

# The public IP of the manager to which the CLI will connect.public_ip: '192.168.153.102'# The manager's private IP address. This is the address which will be used by the# application hosts to connect to the Manager's fileserver and message broker.private_ip: '192.168.153.102'# SSH user used to connect to the managerssh_user: 'root'# SSH key path used to connect to the managerssh_key_filename: '/root/.ssh/id_rsa'# This is the user with which the Manager will try to connect to the application hosts.agents_user: 'root'

注释中都有说明变量的作用,大体是配置用户root能通过ssh key文件/root/.ssh/id_rsa免密码登录192.168.153.102(该ip为我的机器ip)

为节省时间,以及避免网络问题导致文件下载失败,致使安装失败,提前把所需的文件下载好,并修改simple-manager-blueprint.yaml中文件下载的url
所需的文件如下:
http://www.getcloudify.org/spec/cloudify/3.4/types.yaml
http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml
http://repository.cloudifysource.org/org/cloudify3/3.4.0/ga-RELEASE/cloudify-manager-resources_3.4.0-ga-b400.tar.gz
http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml
http://www.getcloudify.org/spec/aws-plugin/1.4.1/plugin.yaml
http://www.getcloudify.org/spec/tosca-vcloud-plugin/1.3.1/plugin.yaml
http://www.getcloudify.org/spec/vsphere-plugin/2.0/plugin.yaml
http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml
http://www.getcloudify.org/spec/diamond-plugin/1.3.3/plugin.yaml
http://www.getcloudify.org/spec/cloudify/3.4/types.yaml
下载完后,放在自己的web服务器上,并修改simple-manager-blueprint.yaml中url
例如

- {'source_path': 'http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml', 'destination_path': '/spec/openstack-plugin/1.4/plugin.yaml'}

修改为

- {'source_path': 'http://192.168.153.10/getcloudify/spec/openstack-plugin/1.4/plugin.yaml', 'destination_path': '/spec/openstack-plugin/1.4/plugin.yaml'}

最后,要保证cloudify manager系统组件所需的端口未被占用,系统组件当中没有不同版本的组件安装在机器上。

4) cfy命令安装cloudify manager

$ cfy bootstrap --install-plugins -p /root/cloudify-use/simple-manager-blueprint/cloudify-manager-blueprints-3.4/simple-manager-blueprint.yaml  -i /root/cloudify-use/simple-manager-blueprint/cloudify-manager-blueprints-3.4/simple-manager-blueprint-inputs.yaml

等待安装完成,大约10几分钟,看机器配置。

5) 登录cloudify manager

cloudify manager的web端口为80
浏览http://192.168.153.102

接下来按照官网去使用cloudify manager部署一个应用吧

0 0
原创粉丝点击