基于盛大云IaaS部署CloudFoundry平台

微生翼
2023-12-01

本文主要介绍针对盛大云的IaaS平台搭建PaaS平台(CloudFoundry)的过程(单机版本)。

(1)申请盛大云的云主机一台。配置类型为(标准主机 | 8 ECU (单核) 4G 60G),操作类型为(Ubuntu10.04 | 64位 基础),带宽(BGP线路2Mbps)(https://hbc2.grandcloud.cn/#/dashboard)。

(2)以root账号登陆远程连接到盛大云主机

(3)由于cloudfoundry的源码是由github托管的,先安装git

 root@SNDA-xxx-xxx-xxx-xxx:~# apt-get install git-core

(4)在/root下创建文件夹cloudfoundry,下载源码到到cloundry中

root@SNDA-xxx-xxx-xxx-xxx:~# mkdir cloudfoundry

root@SNDA-xxx-xxx-xxx-xxx:~/cloudfoundry# git clone https://github.com/cloudfoundry/vcap.git
Initialized empty Git repository in /root/cloudfoundry/vcap/.git/
remote: Counting objects: 15019, done.
remote: Compressing objects: 100% (5922/5922), done.
remote: Total 15019 (delta 8756), reused 13513 (delta 7638)
Receiving objects: 100% (15019/15019), 477.64 MiB | 1.96 MiB/s, done.
Resolving deltas: 100% (8756/8756), done.

      (这个过程取决于你的带宽。可以去喝个茶先。。。)

(5)目前可以使用vcap/dev_setup/bin中的脚本vcap_dev_setup执行安装过程。(又是一个比较漫长的过程)

root@SNDA-xxx-xxx-xxx-xxx:~/cloudfoundry/vcap/dev_setup/bin# ./vcap_dev_setup -d /root/cloudfoundry。

-d表示cloudfoundry的home目录。如果不指定的话,将会从github上重新下载一份。

Deployment Info
***************
* Status: Success
* Config files: /root/cloudfoundry/.deployments/devbox/config
* Deployment name: devbox
* Note:
  * If you want to run ruby/vmc please source the profile /root/.cloudfoundry_deployment_profile
  * If you want to run cloudfoundry components by hand please source the profile /root/.cloudfoundry_deployment_local
* Command to run cloudfoundry: /root/cloudfoundry/vcap/dev_setup/bin/vcap_dev start

(6)启动CloudFoundry

root@SNDA-xxx-xxx-xxx-xxx:~/cloudfoundry/vcap# dev_setup/bin/vcap_dev start
Targeting deployment "devbox" with cloudfoundry home "/root/cloudfoundry"
Setting up cloud controller environment
Setting up the uaa environment
Using cloudfoundry config from /root/cloudfoundry/.deployments/devbox/config
Executing /root/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/bin/ruby /root/cloudfoundry/vcap/dev_setup/bin/vcap start cloud_controllermysql_node postgresql_node health_manager mysql_gateway filesystem_gateway rabbitmq_node vblob_gateway stager mongodb_node postgresql_gatewayuaa mongodb_gateway dea vblob_node redis_gateway rabbitmq_gateway router redis_node -c /root/cloudfoundry/.deployments/devbox/config -v/root/cloudfoundry -l /root/cloudfoundry/.deployments/devbox/log
cloud_controller              :  RUNNING
mysql_node                    :  RUNNING
postgresql_node               :  RUNNING
health_manager                :  RUNNING
mysql_gateway                 :  RUNNING
filesystem_gateway            :  RUNNING
rabbitmq_node                 :  RUNNING
vblob_gateway                 :  RUNNING
stager                        :  RUNNING
mongodb_node                  :  RUNNING
postgresql_gateway            :  RUNNING
uaa                           :  RUNNING
mongodb_gateway               :  RUNNING
dea                           :  RUNNING
vblob_node                    :  RUNNING
redis_gateway                 :  RUNNING
rabbitmq_gateway              :  RUNNING
router                        :  RUNNING
redis_node                    :  RUNNING

(7)查看cf的运行信息

root@SNDA-xxx-xxx-xxx-xxx:/# vmc target


[http://api.vcap.me]


root@SNDA-xxx-xxx-xxx-xxx:/# vmc register
Email: xxxxxxxxxxxx@163.com
Password: **************
Verify Password: **************
Creating New User: OK
Attempting login to [http://api.vcap.me]
Successfully logged into [http://api.vcap.me]
root@SNDA-xxx-xxx-xxx-xxx:/# vmc info


VMware's Cloud Application Platform
For support visit http://support.cloudfoundry.com


Target:   http://api.vcap.me (v0.999)
Client:   v0.3.21


User:     zdq123.hn@163.com
Usage:    Memory   (0B of 2.0G total)
          Services (0 of 16 total)
          Apps     (0 of 20 total)


root@SNDA-xxx-xxx-xxx-xxx:/# vmc apps


No Applications


root@SNDA-xxx-xxx-xxx-xxx:/# vmc services


============== System Services ==============


+------------+---------+-------------------------------+
| Service    | Version | Description                   |
+------------+---------+-------------------------------+
| blob       | 0.51    | Blob service                  |
| filesystem | 1.0     | Persistent filesystem service |
| mongodb    | 1.8     | MongoDB NoSQL store           |
| mysql      | 5.1     | MySQL database service        |
| postgresql | 9.0     | PostgreSQL database service   |
| rabbitmq   | 2.4     | RabbitMQ message queue        |
| redis      | 2.2     | Redis key-value store service |
+------------+---------+-------------------------------+


=========== Provisioned Services ============


至此,CloudFoundry单机版本就基本部署完了。


 类似资料: