In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to create an Azure virtual host in Docker Machine. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
Azure suggests that we organize resources through resource group. For demonstration purposes, we create a new resource group named nickcontainer to store the virtual machine to be created:
There is nothing in the resource group at this time.
Create a virtual machine on the cloud
With Docker Machine, you can do it with a create command:
Docker-machine create\-- driver azure\-- azure-environment AzurePublicCloud\-- azure-subscription-id xxxxxxxxxxxxxxxxxxxxxxxxxx\-- azure-location "East Asia"\-azure-size Standard_A0\-- azure-image canonical:UbuntuServer:16.04.0-LTS:latest\-- azure-ssh-user nick\-- azure-resource-group nickcontainer\-- azure-availability-set testvmtiggeras\ testvmtigger
Users using domestic Azure should change the parameter-- azure-environment AzurePublicCloud to-- azure-environment AzureChinaCloud.
To execute the above command, we will first verify whether we have permission to access Azure for operation:
At this point, the execution process stops. The output of the figure above makes it clear that you need to access https://aka.ms/devicelogin in the browser, and then enter a verification code:
Fill in the CAPTCHA and continue:
Enter your subscription account and password here to complete the authentication:
At this point, the authentication process is complete, and you can close the browser. When I went back to the command line, I found that it was executed again. The whole process takes about a few minutes until the following is output:
Let's take a look at the status of the virtual testvmtigger:
Already in the "Runing" state, try connecting to Docker daemon:
You can see that the server-side version is 17.05.0-ce, which is much higher than the local client version.
Let's go back to Azure's portal and see what's newly created in resource group:
I was startled to see it. Why are there so many things? In fact, students who have played with Azure virtual machines know that when we create a virtual machine, we will create all the resources that the virtual machine depends on, such as storage, virtual networks, network security groups, availability sets, network cards, public IP addresses, and so on. Here we only care about two points (the red box in the picture above): first, the virtual machine has been successfully created; second, the region of all resources is in East Asia.
After a round of inspection, we can confirm that the create command did a good job: the virtual machine was created on Azure and the Docker environment was installed. Let's explain some of the main parameters in the create command.
Detailed explanation of parameters
-- driver azure
The driver parameter tells Docker Machine that the object we are operating on is on the Azure cloud and needs to be operated using Azure-related interfaces.
-- azure-environment AzurePublicCloud
In fact, there are several independent Azure cloud environments, such as domestic ones. So you need this parameter to specify the specific Azure cloud environment. The default is AzurePublicCloud, which points to what we call the international version of Azure. The connection to the domestic version needs to be specified as AzureChinaCloud.
-- azure-subscription-id xxxxxxxxxxxxxxxxxxxxxxxxxx
This is the subscription ID,Azure associated with your account. All internal operations depend on this ID.
-azure-location "East Asia"
Azure deploys many data centers around the world, and we can specify the location of the created resources through location. Of course, this location is as close to the user as possible, and the domestic and international version users choose East Asia slightly better.
-- azure-size Standard_A0
Azuer charges virtual machines according to different size (that is, configuration). The Standard_A0 selected in demo looks like this:
Although the configuration is not high, it is enough for demo. MS offers a wealth of size to choose from, and if you want to create virtual instances of a production environment, you may need to choose instances that cost tens to hundreds of dollars a month.
-- azure-image canonical:UbuntuServer:16.04.0-LTS:latest
For the production environment, the mirror image of the virtual machine is very important. Ubuntu server 16.04 images are used in Demo, and of course we can specify any virtual machine images supported by Azure here. This is much better than a driver that can only use boot2docker!
-- azure-ssh-user nick
Users who can log in to the virtual machine through SSH, let's try it:
It is successful to log in directly as the user nick. In fact, Docker Machine has already configured the relevant information for this user to log in through the secret key.
-- azure-resource-group nickcontainer
The resource group to which the newly created resource belongs.
Clear resourc
Docker Machine can not only create virtual machines, but also manage them. Is the so-called management only able to stop, start and restart? The answer is that there can be more functions, but it needs the support of related drivers. For example, the rm command, for the azure driver, can kill almost all of the things you just created! Execute the following command:
$docker-machine rm testvmtigger
This is a dangerous operation, so there will be a step to confirm the execution, and then the resources on the Azure will actually be killed (except for the storage part):
On how to create an Azure virtual host in Docker Machine to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.