In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to achieve the elastic scaling of Service/Host through Rancher webhook micro-services, many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can get something.
Overview
Here is how to achieve the elastic scaling of Service/Host through Rancher's webhook micro-service.
Process introduction
Service Scale
Create an example service object.
Create a service scale webhook object.
A third party triggers webhook to complete service auto scaling.
Host Sacle
Create an instance object through Aliyun machine driver and tag it with scale-up.
Create a host scale webhook object.
A third party triggers webhook to complete host auto scaling.
Webhook introduction
The service flow of Rancher webhook is roughly as follows:
Webhook Driver (WD) initialization.
Router Handler (RH) initialization.
Receive the request URL and Method, match to call RH.Execute or other methods, RH.Execute parses the request data to get WD_Id, then executes WD.Execute, and finally returns and response.
Environment preparation Platform
Mac,Windows,Linux,Docker Cloud,AWS,Azure can be deployed.
The platform to be prepared this time is Ubuntu release (14.04). In order to be compatible with docker, the kernel should be controlled above 3.10 when selecting linux distribution.
Docker
Install the docker engine according to the platform you choose. For installation instructions, please refer to the official https://docs.docker.com documentation and use it with Rancher. The best version of docker engine is 1.12.6 or 1.13.1. The docker engine version to be prepared this time is 1.12.6.
Rancher
Practice step Service Scale
Create example service
Curl-u "xx:xx"\-X POST\-H 'Accept: application/json'\-H' Content-Type: application/json'\-d'{"description": "example service for scaling", "name": "webapp", "system": false "dockerCompose": "version:'2'\ nservices:\ nNGX:\ nimage: nginx:alpine\ nstdin_open: true\ ntty: true\ ncpuset:\" 0\ "\ nports:\ n-8787:80/tcp\ ncpu_shares: 1024\ nlabels:\ nio.rancher.container.pull_image: always\ nservicename: nginx" "rancherCompose": "version:'2'\ nservices:\ nNGX:\ nscale: 1\ nstart_on_create: true", "binding": null, "startOnCreate": true}''http://a.b.c.d:8080/v2-beta/projects/1a5/stacks'
Create webhook
Trigger webhook
Host Scale
Create example host
Create webhook
Trigger webhook
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.