Introduction to the system, cloud computing services, learning and sharing of cloud best practices on the project

Posted by Solar on Thu, 06 Jan 2022 16:15:12 +0100

HD [class representative \ /: ebing6] learn together

System entry cloud computing services

Cloud computing is the next stage of Internet evolution. It provides all means from computing power to computing infrastructure, applications to business processes. Whatever is needed, it can be provided as cloud services. Cloud computing brings huge benefits to small, medium and large enterprises. Some people think that cloud computing is still in its infancy and have positive and negative comments on the possible implementation of large enterprises. On the other hand, enterprises are facing great pressure to use cloud services, but they need to fully understand the challenges brought by cloud computing. System entry cloud computing services, cloud best practices on the project, and switching to cloud services provide great benefits to enterprises and their users. It is important that the company choose a provider that will help support the transition and balance the challenges. However, like any major concept, it always starts slowly, but once enterprises realize the advantages of cloud services, it will be used quickly. Despite these challenges, companies are increasingly aware of the business value brought by cloud computing and are accelerating their transformation to the cloud.

Download: System entry, cloud computing services, cloud best practices on the project

Cloud best practices on the project - cloud service deployment skills, cloud service project architecture scheme

System entry, cloud computing services, cloud best practices on the project

2, Scale of operation and maintenance team investigated in the early stage of the project (4): 1 operation and maintenance engineer, 1 operation and maintenance architect and 1 network engineer

Customer R & D / test team size: 30

Customer Telecom room resources:

Three cabinets, 40 or so hardware servers (mainly dell r410, in fact, two 16 core / 96G memory are used for xen virtualization) 200Mbps (exclusive) customer environment introduction:

Because there are a large number of commodity pictures in the e-commerce environment, CDN is essential. On the server side, the front end uses nginx+varnish as the secondary cache, which mainly reduces the pressure of CDN back to source access. The back-end business system has more than ten names, such as designe/kderp/seach/res/seo/oc/img, and the development languages are mainly Java, php and python. The operating system is mainly centos, with a small amount of windows environment. Image source files are mainly mounted and shared through nfs, and the amount of image data is 2T +. The database cache side mainly uses redis as the database cache to reduce the pressure on the database. The database side is mainly mysql. MySQL master-slave is deployed on the hardware server.

3, Cloud best practices on the project confirm cooperation intention. From the perspective of customers, there are three pain points:

Although the cloud does have great advantages in cost, expansion, flexibility and quickness. However, there is a certain technical threshold for the flexible use of cloud products and cloud architecture. How to use cloud resources to design a low-cost and high-performance architecture is an empirical technical activity. The customer does not have a 724 monitoring and response center, which often leads to the failure to contact the operation and maintenance in time and respond immediately, so the 724 of the operation and maintenance cannot be guaranteed. The customer has four operation and maintenance personnel, and the high cost is also the most substantive pain point. Therefore, through negotiation, the cooperation intention was finally determined at the end of December (the specific business details are not summarized here). We provide customers with cloud architecture solutions + cloud migration + 724 monitoring + 724 operation and maintenance services (our operation and maintenance is the main service, supplemented by customer operation and maintenance) to solve their pain points.

4, Challenges of cloud migration in project cloud Best Practices 1: short time: the customer computer room expires in February, and Valentine's Day is the business peak of the year on February 14 every year. Since the time point for business cooperation has been determined by the end of December, we need to complete the cloud migration, testing and formal launch of the project in mid January (only two weeks), and reserve two weeks as the observation transition period. Challenge 2: there are many business systems and technical environments: through combing, customers have more than ten business systems. There are many technical environments such as Nginx, varnish, tomcat, php, python, redis and mysql, which greatly increases the difficulty of migration. Challenge 3: zero configuration document, zero specification: actually make complaints about this challenge. It is hard to imagine that a system that has been in operation and maintenance for eight years does not have a document in the operation and maintenance configuration document and operation and maintenance manual, but only a few fragmentary architecture diagrams. In addition, the specification of host name, firewall and configuration file is chaotic. During the migration, I also encountered a funny thing. I forgot the switch password in the computer room, and then the network engineer cracked it to obtain the latest password. We can imagine the difficulty and challenges of migration.

5, Project cloud best practices cloud migration

Project cloud practice

Introduction to the system, cloud computing services, and actual development of cloud best practices on the project

from configparser import ConfigParser
from threading import Timer
import requests 
import random
import hashlib
import datetime
import time
import json
import logging
import math

logger = logging.getLogger()
grade = [10,40,70,130,200,400,1000,3000,8000,20000]
api = ''

class Task(object):

    '''
    Object Constructors 
    '''
    def __init__(self, uin, pwd, pushmethod, sckey, appToken, wxpusheruid, countrycode=86):
        self.uin = uin
        self.pwd = pwd
        self.countrycode = countrycode
        self.pushmethod = pushmethod
        self.sckey = sckey
        self.appToken = appToken
        self.wxpusheruid = wxpusheruid
    '''
    Bring the user's cookie To send data
    url:complete URL route
    postJson:To post Data sent by
    return response
    '''
    def getResponse(self, url, postJson):
        response = requests.post(url, data=postJson, headers={'Content-Type':'application/x-www-form-urlencoded'},cookies=self.cookies)
        return response

    '''
    Sign in
    '''
    def login(self):
        data = {"uin":self.uin,"pwd":self.pwd,"countrycode":self.countrycode,"r":random.random()}
        if '@' in self.uin:
            url = api + '?do=email'
        else:
            url = api + '?do=login'
        response = requests.post(url, data=data, headers={'Content-Type':'application/x-www-form-urlencoded'})
        code = json.loads(response.text)['code']
        self.name = json.loads(response.text)['profile']['nickname']
        self.uid = json.loads(response.text)['account']['id']
        if code==200:
            self.error = ''
        else:
            self.error = 'Login failed, please check your account'
        self.cookies = response.cookies.get_dict()
        self.log('Login succeeded')

    '''
    Daily check-in
    '''
    def sign(self):
        url = api + '?do=sign'
        response = self.getResponse(url, {"r":random.random()})
        data = json.loads(response.text)
        if data['code'] == 200:
            self.log('Check in succeeded')
        else:
            self.log('Repeat check-in')

    '''
    Punch in 300 songs a day
    '''
    def daka(self):
        url = api + '?do=daka'
        response = self.getResponse(url, {"r":random.random()})
        self.log(response.text)

    '''
    Query user details
    '''
    def detail(self):
        url = api + '?do=detail'
        data = {"uid":self.uid, "r":random.random()}
        response = self.getResponse(url, data)
        data = json.loads(response.text)
        self.level = data['level']
        self.listenSongs = data['listenSongs']
        self.log('User details obtained successfully')

    '''
    Wxpusher Push
    '''
    def wxpusher(self):
        if (self.appToken == '' or self.wxpusheruid == ''):
            self.log('Not filled in WxPusher Push required parameters, please check')
            return
        self.diyText() # Construct send content
        url = 'https://wxpusher.zjiecode.com/api/send/message/'
        data = json.dumps({
            "appToken":self.appToken,
            "content":self.content,
            "summary":self.title,
            "contentType":3,
            "uids":[self.wxpusheruid]
        })
        response = requests.post(url, data = data, headers = {'Content-Type': 'application/json;charset=UTF-8'})
        if (response.json()['data'][0]['status']) == 'Sending task created successfully':
            self.log('user:' + self.name + '  WxPusher Push succeeded')
        else:
            self.log('user:' + self.name + '  WxPusher Push failed,Please check appToken and uid Is it correct')

    '''
    Customize the content to be pushed to wechat
    title:The title of the message
    content:Content of the message,support MarkDown format
    contentType:Message type,1 Normal text,2 by html,3 by markdown
    '''

    '''
    Server Push
    '''
    def server(self):
        if self.sckey == '':
            return
        self.diyText() # Construct send content
        data = {
            "text":self.title,
            "desp":self.content
        }
        if (self.pushmethod.lower() == 'scturbo'):      #Server Turbo
            url = 'https://sctapi.ftqq.com/' + self.sckey + '.send'
            response = requests.post(url, data=data, headers = {'Content-type': 'application/x-www-form-urlencoded'})
            errno = response.json()['data']['errno']
        else:                                           #Server normal
            url = 'http://sc.ftqq.com/' + self.sckey + '.send'
            response = requests.post(url, data=data, headers = {'Content-type': 'application/x-www-form-urlencoded'})
            errno = response.json()['errno']
        if errno == 0:
            self.log('user:' + self.name + '  Server Sauce pushed successfully')
        else:
            self.log('user:' + self.name + '  Server Paste push failed,Please check sckey Is it correct')

    '''
    Customize the content to be pushed to wechat
    title:The title of the message
    content:Content of the message,support MarkDown format
    '''

    def diyText(self):
        # today = datetime.date.today()
        # kaoyan_day = datetime.date(2020,12,21) #The end of the postgraduate entrance examination party in 2021
        # date = (kaoyan_day - today).days
        for count in grade:
            if self.level < 10:
                if self.listenSongs < 20000:
                    if self.listenSongs < count:
                        self.tip = 'You still need to listen to music' + str(count-self.listenSongs) + 'First upgrade'
                        break
                else:
                    self.tip = 'You've heard enough 20000 songs,If the login days reach 800 days, you can reach the full level'
            else:
                self.tip = 'Congratulations, you have reached the level!'
        if self.error == '':
            state = ("- Check in has been completed\n"
                    "- Punch in today" + str(self.dakanum) + "second\n"
                    "- Play today" + str(self.dakaSongs) + "Song\n"
                    "- You also need to punch in" + str(self.day) +"day")
            self.title = ("Netease cloud punch in today" + str(self.dakaSongs) + "First, played" + str(self.listenSongs) + "first")
        else:
            state = self.error
            self.title = 'There is a problem with Netease cloud song listening task!'
        self.content = (
            "------\n"
            "#### Account information \ n“
            "- User name:" + str(self.name) + "\n"
            "- Current level:" + str(self.level) + "level\n"
            "- Cumulative playback:" + str(self.listenSongs) + "first\n"
            "- Upgrade tips:" + self.tip + "\n\n"
            "------\n"
            "#### Task status \ n "+ str (state) +" \ n \ n“
            "------\n"
            "#### Clock in log \ n "+ self.dakasongs_list +" \ n \ n ")

Topics: CODE