Use arm templates to deploy DC/OS clusters on a large scale in azure China

Source: Internet
Author: User

Container technology is currently a very popular technology, especially driven by the use of docker as a container engine, so that containers are lightweight, portable, and self-contained, isolation has taken a new step. Currently, when talking about Dev/OPS, Ci/CD rarely bypasses docker.

Azure launched the container service ACS last year. It is well received for its comprehensive compatibility, openness, and comprehensive orchestration tool (DC/OS, kubernetes, and swarm) for open source, however, ACS is not available in China and many regions. How to quickly deploy container services in these regions is always a problem.

Microsoft went further. In the early November S, it further opened up ACs-engine, the Core Engine of ACS, developers can use ACs-engine to quickly generate arm templates that can be deployed in all regions, including China, without relying on ACS container resource provider, this is a good news for developers and maintenance personnel. I don't have to work hard to debug and modify scripts and arm templates to deploy DC/OS clusters in azure China like me :)


ACS-engine official address:

Many cool people have already written some amazing ACs-engine articles. This article is based on my actual tests and records some problems and solutions, I hope this will be helpful for quick deployment.

First, let's take a brief look at the deployment architecture of the DC/OS cluster. We have a master high availability set, and the master can choose 1, 3, and 5 virtual machines; there is a public agent VMSs set that is mainly used to deploy applications that are accessible to Internet users. A private agent's VMSs cannot be accessed through the public network and runs some default calculations:

650) This. width = 650; "src =" "style =" border: 0px; "/>

Install and configure ACs-engine
  1. Download the installation package suitable for your operating system on the go language Official website. For example, download and install the go language package in Ubuntu:




    650) This. width = 650; "src =" "style =" border: 0px; "/>


  2. In Linux, create a sub-directory gopath under your user directory and add the following lines to your $ home/. profile file:

Export Path = $ path:/usr/local/go/bin

Export gopath = $ home/gopath


  1. Go to your gopath directory, download ACs-engine, and update related components:

    Go get

    Go get all

    650) This. width = 650; "src =" "style =" border: 0px; "/>

  2. Open dcosprovision under parts. sh file, you can see that many packages need to be downloaded from abroad, due to GFW, your installation will become very slow, or fail, first download the following package to your local server, create an image:

    From the following address:




    Download the following package to your china backup storage:

5b4aa436101_ee1d60b4aa0751a1fb751_c083.bootstrap.tar. xz (about 551 m)

Docker-engine_1.11.2-0 ~ Xenial_amd64.deb





  1. Go to your ACs-engine root directory and build your ACs-engine:

    CD $ gopath/src/

    Go build


    650) This. width = 650; "src =" "style =" border: 0px; "/>

  2. As you can see, if you want to generate a JSON template, you need a clusterdefinitionfile. There are various example files in example. Take DCOs as an example. You can see that edit example/DCOs. JSON, modify the following red section and save it:

    "Masterprofile ":{

    "Count": 1,

    "Dnsprefix": "dcosmaterdemo ",

    "Vmsize": "standard_d2"



    "Name": "agentpublic ",

    "Count": 3,

    "Vmsize": "standard_d2 ",

    "Dnsprefix": "dcosagentdemo ",

    "Ports ":[







    "Publickeys ":[


    "Keydata": "yourkey"



  3. Run ACs-engine to generate your arm Template


    ./ACs-engine examples/DCOs. JSON


    650) This. width = 650; "src =" "style =" border: 0px; "/>


  4. This step is very important. You need to manually open the generated azuredeploy. JSON file and modify the following CDN download source to your china image address. Otherwise, your deployment will fail:




  5. The rest is easier. Use azure CLI to deploy your DC/OS cluster:


    # Log on to Azure in China using azure CLI:

    Azure login-u username-P password-e azurechinacloud

    650) This. width = 650; "src =" "style =" border: 0px; "/>

    # Create a resource group:

    Azure group create -- name = "Steven acsdcosgp" -- location = "China East"

    650) This. width = 650; "src =" "style =" border: 0px; "/>


    # Execute deployment:

    Azure group deployment create -- name = "mydcoschinadeploy" -- Resource-group = "Steven acsdcosgp" -- template-file = ". /_ output/DCOS184-10726092/azuredeploy. JSON "-- parameters-file = ". /_ output/DCOS184-10726092/azuredeploy. parameters. JSON"

    650) This. width = 650; "src =" "style =" border: 0px; "/>


  6. After the deployment is complete, you can view the successful deployment information in the new portal. In my actual environment, the deployment process only requires more than eight points, please record the Master Address highlighted in Yellow:


    650) This. width = 650; "src =" "style =" border: 0px; "/>

  7. Then we need to connect to the DC/OS cluster, use the master1_dn address, port is 2200, use your private key file (PPK file), establish tunnel port is 80, and connect:

    650) This. width = 650; "src =" "style =" border: 0px; "/>


    Auth Configuration:


    650) This. width = 650; "src =" "style =" border: 0px; "/>

    Tunnel Configuration:

  8. After the connection, open your browser, enter http: // localhost/, and you will see the following DC/OS dashboard. Then you can enjoy playing with docker, DC/OS:

    650) This. width = 650; "src =" "style =" border: 0px; "/>

TIPS: If you happen to be unfortunately unable to connect When configuring the SSH tunnel, check the putty Event Log and see the Permission denied error. I have found a solution to save your time, follow these steps:

650) This. width = 650; "src =" "style =" border: 0px; "/>

Check netstat-Aon | findstr "80"

Some services use ntoskrnl to occupy port 80. For example, WS-management causes local tunnel failure:

650) This. width = 650; "src =" "style =" border: 0px; "/>

Net stop HTTP

650) This. width = 650; "src =" "style =" border: 0px; "/>


From the above documents, we can see that using ACs-engine can easily generate an arm template for large-scale deployment of azure in China, but with this template, you can simply modify the parameters, you can re-deploy the service. You don't need to generate it every time. So I have put the generated template on GitHub and want to deploy it in China:


  1. Clone or download all current files

  2. Modify http: // yourchinaserver in azuredeploy. JSON for your own server,

  3. Modify all places marked as changit in azuredeploy. Parameters. JSON.

  4. Modify deployname in the deploy. PS1 file as your resource group name

  5. Log on to your azure account and run deploy. PS1 in arm mode.

  6. Linux and Mac users can also use azure CLI for deployment.

Use arm templates to deploy DC/OS clusters on a large scale in azure China

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.