In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Foreword:
For Rancher installation, please refer to Rancher-Server deployment. The procedure in this article is demonstrated based on the above deployment environment. Please know for yourself what Rancher does, what functions it can accomplish, and what advantages it has.
This article mainly introduces the following points
What is the environment?
How to add an environment
What is the application stack?
How to add, delete, and modify application stacks
What is service?
How to add, remove, upgrade services
What is a mainframe?
How to add, delete, and manage hosts
What is the environment:
In general, the project is divided into test environment, development environment and online environment. Or different project teams use different environments, such as A project environment, B project environment. Thus it can be seen that Rancher supports unified management of multi-environment requirements, and different environment templates can be used for different environments. For example, the network model used in the development environment can be ipsec, while the test environment and online environment can use the vxlan network mode. Different environments are completely isolated, but unified management can be achieved, and different environments can be assigned for different users. For example, Admin users can manage all environments, then Admin users can view the configuration and management of all environments, and A users can only manage the test environment. Then user A can only see the configuration of the test environment, but not the configuration of other environments.
What is the application stack:
In my understanding, an application stack is a collection of the same set of services, such as DB application stack, WEB application stack, registry application stack, LB load balancing application stack, etc.
What is a service:
A service is a set of containers (at least 1) started by the same image, the same configuration, and provides the same service. For example, you can create a web service from a nginx image, in which there are more than one container and expose the same port to the host (if the port is exposed, you need to schedule these containers to run on different hosts, otherwise there will be port conflicts), map the same directory and other configurations, this is the service.
What is a host:
After we install Rancher-Server, we must add at least one host, because our container runs on these hosts. So it can be understood as a host, that is, Rancher-Server manages an Agent node. The host can be a virtual machine or a physical machine. The host is not limited to geographical location, as long as it can communicate with the Server and can be managed.
Now that we have understood some basic concepts through the brief introduction above, let's start to demonstrate the basic use of these features in the form of pictures:
First of all, you do not need to enter a password to access our Server management platform by default, which is not secure, so we should also configure authentication. In addition, you can adjust the display language to Chinese (90% supports Chinese) according to your personal usage habits as follows:
Opening the management platform for the first time will prompt a welcome interface, mainly a basic interface and a link to a document, remove "√" and click Got It and
The default language may be displayed in English, so click "English" in the lower right corner to select "simplified Chinese" and can be displayed in Chinese.
Place the cursor over "system Management" and select "access Control" to open as shown in the following figure: then select "LOACL", configure the first administrator user, and then click "start access Control".
The steps to add a host are as follows:
Click "Infrastructure" > "Host" and then click "add Host". First, add the URL that the host prompts the host to register by default. The default is to use the IP address. If it is a cluster environment, change URL to a domain name that can be resolved by DNS. Then save, go to the add host interface, just fill in the IP address of the added host in step 4, then copy the following connection to the added host for execution, then click close, and a host will appear in the operation interface.
Description of the host interface: through the following interface, we can see that it shows the computer name, IP address, Docker version number, CPU, memory hard disk and other information of the host, as well as the container running above the host and the application stack (Stack) information to which the container belongs. By default, we start some basic containers when starting an Agent, such as health check, height, network management, etc. These windows that need to be started can be specified by default through our environment configuration, which will be described later on how to manage the environment.
Through this interface, the buttons in the upper right corner of the host can edit the host, modify the description information, add tags, view the host management API and other information. You can also click the host name directly to view more detailed information such as the load pressure of the host.
Now continue to follow the above method, add another host, so that you can form a small cluster environment, the process will not be demonstrated
Next, we need to add the hospital application stack. Click "Application Stack" and then click "add Application Stack" to enter the stack name and description information. Click create to enter the current stack configuration by default. What I am creating here is the Web application stack.
The following figure shows the stack configuration. We can click "add Services" in the picture to start our container. For example, we are going to start two Nginx images and then implement load balancing.
Click "add Service" as shown in the window shown below: fill in the name, that is, the name specified when the container starts, and select the image from which to start. If the image is not found, it will automatically start from the default site pull the image. In general, it is recommended to build a private warehouse, and then select the port to be exposed. We will not expose it here, and then schedule it by creating a load balancer. Then there are some configurations below, which can be set according to your own needs, and finally click create. If you need to download the image from the Internet, the speed is a bit slow. If you need to wait a while, the service will be displayed as "Active", indicating that the startup is successful.
Just now, when we created the service, we only started one container by default. We can click on the newly created "nginx" service, and then click "+ -" on the left to add or delete the container (as shown in the following figure). Similarly, you can also click the three buttons on the far right of the service to upgrade the service. Upgrade means to change some configuration information started by the container. The interface is like adding services.
At this time, our container cannot be accessed because the port is not exposed, so we need to add a LB application stack according to the previous method, then add a "load balancer" service to the LB application stack, and select "add load balancer" when adding services, as shown in the following figure: enter Name, and then enter the port to be exposed under the first Port. Then select the nginx service you just created at Target, and then enter the final Port corresponding to the port in the container, and click create and
When we created the nginx service and the load balancer, we did not specify which host to run on. The system will schedule automatically, schedule according to the pressure load, or create a label for the host, and then schedule it according to the label. When the load balancer starts successfully, as shown in the following figure, click the port number in the middle to access our nginx welcome page directly. Here we default that we only have one load balancer running. We can run the same load balancer on each host, and then add a nginx load balancer to the front end to achieve cross-load balancing. This load balancer will increase or decrease according to the increase of the backend service container, and then the configuration file will be updated synchronously automatically. Haproxy debugging is used by default.
New user: click "system Management" and then "access Control" and then "manage account" and finally "add account" to add an ordinary account to be used when creating an environment. Select "user" for the account type.
Add environment: place the cursor in the upper left corner of the cursor to "Default" (default environment name is Default) and click "Environment Management" to open the interface shown below. As shown below, we have only one Default environment and five default environment templates. We can add environment templates here or add new environments based on existing templates.
We can just use the existing template here. Click "Add Environment", then enter the name of the environment, select the template used by the environment, then go to the bottom configuration, enter the user name you just created, click the "+" sign on the last side, add it below, and then select the permissions of this account for this environment, click create and
Through the above simple learning, we have completed the implementation of some simple functions, and many interesting functions still need to be tested by ourselves. It is found that we will continue to share some simple uses such as API,vxlan, external DNS, and communication between containers. More advanced uses will also be shared as separate knowledge points.
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.