当前位置: > Linux服务器 > 环境配置 >

基于Docker、阿里云、JFinal的java saas平台搭建

时间:2015-10-06 22:54来源:linux.it.net.cn 作者:IT

愿景

用户不用再自己购买服务器已经搭建应用环境,在我们平台用户一键自助完成应用的创建、启动等过程!

第一版、单机

由于第一版为功能测试版本Manage为我们的平台,Manage通过docker_remote_api控制docker,并且生成nginx配置文件和reloadnginx

构建图

+---------------------------------+
|                                 |
|       +----------------+        |
|       |     Nginx      |        |
|       +-------++-------+        |    +--------------+
|               ||                |    |              |
|       +-------++-------+        |    |              |
|       |     Manage     | +------------+ Aliyun RDS  |
|       +-------++-------+        |    |              |
|               ||                |    |              |
|       +-------++-------+        |    +--------------+
|       |                |        |
|       |                |        |
|       |     Docker     |        |
|       |                |        |
|       |                |        |
|       +----------------+        |
|                                 |
|          ECS(Centos)            |
|                                 |
+---------------------------------+

第二版、多台服务器(学了下老外作图,我这是作死啊)

  1. 添加了镜像仓库
  2. nginx改为使用inotifywait监控配置include目录reloadnginx
  3. Manage内部添加远程Api和客户端,方便对各个服务上的docker实例实现控制
+-----------------------------------------------------------------------------------+
|                                                                                   |
|                                      Aliyun RDS                                   |
|                                                                                   |
+----------+-------------------------------+-----------------------------+----------+
           |                               |                             |
+----------+----------+        +-----------+----------+        +---------+----------+
|                     |        |           |          |        |                    |
|  +---------------+  |        |  +--------+-------+  |        |  +--------------+  |
|  | +-----------+ |  |        |  | +------------+ |  |        |  |  +--------+  |  |
|  | |  Manage   | | +----------+ + +   Manage   + + +----------+ |  | Manage |  |  |
|  | +----++-----+ |  |        |  | +-----++-----+ |  |        |  |  +---++---+  |  |
|  |               |  |        |  |                |  |        |  |              |  |
|  |               |  |        |  |                |  |        |  |              |  |
|  |               |  |        |  |                |  |        |  |              |  |
|  |               |  |        |  |                |  |        |  |              |  |
|  |    Docker     |  |        |  |     Docker     |  |        |  |    Docker    |  |
|  |               |  |        |  |                |  |        |  |              |  |
|  |               |  |        |  |                |  |        |  |              |  |
|  |               |  |        |  |                |  |        |  |              |  |
|  |               |  |        |  |                |  |        |  |              |  |
|  |               |  |        |  | +-----++-----+ |  |        |  |              |  |
|  |               | +----------+ + +  registry  + + +----------+ |              |  |
|  |               |  |        |  | +------------+ |  |        |  |              |  |
|  |               |  |        |  +----------------+  |        |  |              |  |
|  +---------------+  |        |                      |        |  +--------------+  |
|                     |        |  +----------------+  |        |                    |
|     ECS(Centos)     |        |  |                |  |        |     ECS(Centos)    |
|                    +----------+ |     Nginx      | +----------+                   |
|                     |        |  |                |  |        |                    |
+---------------------+        |  +----------------+  |        +--------------------+
                               |                      |
                               |      ECS(Centos)     |
                               |                      |
                               +----------------------+

从此,新增服务器,特别方便,只需安装一个docker!

接下来

  1. 完善实例的更新机制
  2. 加强监控
  3. 添加其他Docker组件

使用到的技术和服务

  1. Docker
  2. docker-registry 私有镜像仓库
  3. JFinal
  4. docker-java
  5. JFinal-event
  6. 阿里云ECS(centos 6.5/7)、RDS、OSS

好文收藏

使用Etcd和Haproxy做Docker服务发现

构建一个高可用及自动发现的Docker基础架构-HECD


(责任编辑:IT)
------分隔线----------------------------