O & M platform-based saltstack and jinja2 templates to build a high-availability cluster configuration platform

Source: Internet
Author: User
Tags saltstack

Preface:

I am working on a cluster configuration platform recently. I have also done a similar demo before. I remember that I used the paramiko module last year. I first said that I used ssh to configure the connection, pexpect is also sometimes used for interaction. In complex configurations, problems often occur. The configuration mainly involves the regular expression matching.


Now we are in a new company. The first thing we need to do is to refactor the code to build a configuration tool for the whole network cluster and support platforms for nginx, lvs, and haproxy cluster configuration. It contains automatic flow approval of processes, tests on the test server, configurations before the configuration file operations, and rollback when a problem occurs.


Because the new company's environment is puppet, I plan to promote saltstack! I still like saltsatck's simple secondary development.

My current thinking is:

Use a web framework template to render configuration. It is best to convert nginx. conf keepalived. conf to a format similar to yaml. Push to the client is only a get url. Through the ip address and type of the interface, you can render the configuration file and download it directly.

This can be said to be useless ~ Ah .... I 'd better push saltsatck as much as possible ~


In the following cluster management platform, I wrote it for two days and designed the front-end page and the back-end mysql database. I will update the subsequent ideas and solutions to you. It hasn't been launched yet, just for your reference ~



There is nothing at the front end, that is, the verification of some forms and the js Special Effects of beautification.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/0ZKU5O-0.jpg "title =" lvs1.png "alt =" wKioL1LSrwvhqTLUAAP_YigDFn0757.jpg "/>


Specific format specifications are provided for cluster parameters!

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/0ZKRN8-1.jpg "title =" lvs2.png "alt =" wKiom1LSryTTW3E5AAOKH9yeokI259.jpg "/>


Special instructions. You can enter some special requirements here!

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/0ZKW322-2.jpg "title =" lvs5.png "alt =" wKioL1LSr0PyLbBHAAOsh6w7FW0163.jpg "/>


After you click Submit, an email will be sent to the lead for confirmation ~

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/0ZKT5F-3.jpg "title =" lvs4.png "alt =" wKiom1LSr1uCRJ1QAAOaHZOWLbw197.jpg "/>


Data is written at Will ~

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/0ZKT091-4.jpg "title =" sd.jpg "alt =" wKiom1LTpS2QdnojAAKS8XHPWaI010.jpg "/>


Some problems occurred when mysqldb obtained timestamp. For details, refer to the following section ~


ValueErrorValueError: unsupported format character 'm' (0x6d) at index 138Traceback (most recent call last)


This is required for the % symbol, especially for the formatting time.

FROM_UNIXTIME(unix_timestamp(ltime),"%%m-%%d %%H:%%i")


650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/0ZKT2N-5.jpg "title =" god.jpg "alt =" wKioL1LTt6ij5BNqAALSOwDK3SY134.jpg "/>


Continue tomorrow ~


This article is from "Fengyun, it's her ." Blog, declined to reprint!

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: info-contact@alibabacloud.com 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.