-
[常见FAQ] [ERR]/tmp/tmp.o3Kr2GRpUD/preliminary_judge/IO_zhangyuanlong/ProcessIO.cpp:485|ProcesIO|Read err:0, Success出这种错误什么原因呀 ubuntu系统 使用 ./PreliminaryJudge -m maps/map1.txt smart_port/main
-
今年最后一天了怎么还没动静还有版本更新吗
-
1. 容器集群创建基于在Huawei Cloud API的云容器引擎CCE Python模块,使用以下信息,在/root目录下手动编写cce_cluser.yaml文件。云服务器的/root/目录下编写cce_cluster_manager.py 文件,编码实现读取cce_cluser.yaml,创建“按需计费”的CCE容器引擎集群(Cluster),创建后根据名称查询该集群(Cluster)的详细信息,通过控制台以Json格式输出该集群的信息。创建CCE集群的信息如下,其他必要信息不限。CCE名称:chinaskillscce2022。按需计费:集群版本为v1.21。集群规模:节点数50。网络模式:VPC网络。编写cce_cluster_manager.py文件如下:# =========================================== # Copyright Jiangsu One Cloud Technology Development Co. LTD. All Rights Reserved. # 版权: 江苏一道云科技发展有限公司,版权所有! # =========================================== import time from huaweicloudsdkcce.v3 import * #CCE 3.0 from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkcce.v3.region.cce_region import CceRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkcce.v3 import * def get_aksk_v3_cce_token(): ak = "DQVNQ7NHZCRS9XFCJAME" sk = "jGYmdH66dfittUCEnlr4s9gJjb6xxN4P3tuyPl4j" # EZA2ZDBZANMYYEHUHYBD # GMK5KA5qYRmQiuaIpTyFay6QbZ1pohYGPBmAGklY token = BasicCredentials(ak, sk) client = CceClient.new_builder() \ .with_credentials(token) \ .with_region(CceRegion.value_of("cn-north-4")) \ .build() return client class Cluster_Manager: def __init__(self,client): self.client = client def delete_same_cluster(self,name): client = self.client req = ListClustersRequest() resp = client.list_clusters(req) for cluster in resp.items: if cluster.metadata.name == name: clusterId = cluster.metadata.uid delete_req = DeleteClusterRequest() delete_req.cluster_id = clusterId delete_req.delete_efs = "true" delete_req.delete_evs = "true" delete_req.delete_net = "true" delete_req.delete_obs = "true" delete_req.delete_sfs = "true" delete_resp = client.delete_cluster(delete_req) print(f"删除集群成功:{delete_resp}") return "" def create_cluster(self): client = self.client req = CreateClusterRequest() metadataBody = ClusterMetadata( name="test-cluster" ) hostNetwork = HostNetwork( vpc="178938e4-fb8b-4491-831b-440e3f8d24fa", subnet="8c9a2894-acc8-4e41-a451-fe11b84e2b9f", ) Cidrs = [ ContainerCIDR( cidr="10.0.0.0/16" ) ] containetNetwork = ContainerNetwork( mode="vpc-router", cidrs=Cidrs, ) SpecBody = ClusterSpec( category="CCE", type="VirtualMachine", flavor="cce.s1.small", version="v1.21", host_network=hostNetwork, container_network=containetNetwork, kube_proxy_mode="iptables", ) req.body = Cluster( kind="Cluster", api_version="v3", metadata=metadataBody, spec=SpecBody, ) result = client.create_cluster(req) print(f"创建的集群信息为:{result}") def list_cluster(self): client = self.client req = ListClustersRequest() req.detail = "true" req.status = "Available" req.type = "VirtualMachine" req.version = "v1.21" result = client.list_clusters(req) print(f"获取到当前项目下的集群信息为:{result}") def get_clusterId_by_name(self,name): client = self.client req = ListClustersRequest() resp = client.list_clusters(req) for cluster in resp.items: if cluster.metadata.name == name: clusterId = cluster.metadata.uid print(f"集群的ID为:{clusterId}") return "" def show_cluster(self,clusterId): client = self.client req = ShowClusterRequest() req.detail = "true" req.cluster_id = clusterId result = client.show_cluster(req) print(f"展示当前集群的信息为:{result}") if __name__ == "__main__": cluster_m = Cluster_Manager(get_aksk_v3_cce_token()) # delete_same = cluster_m.delete_same_cluster("test-cluster") # time.sleep(60) #执行删除操作后,睡眠1分钟,因为需要1分钟的时间来将集群彻底删除。 # # create_cluster = cluster_m.create_cluster() # time.sleep(480) #睡眠8分钟,这段时间,在创建集群。需要等集群创建完成之后,才能获取到信息。 list_cluster = cluster_m.list_cluster() clusterId = cluster_m.get_clusterId_by_name("chinaskillscce2022") show_cluster = cluster_m.show_cluster(clusterId) ------------------------------------------执行结果--------------------------------- python3 cce_cluster_manager.py 创建的集群信息为:{"kind": "Cluster", "apiVersion": "v3", "metadata": {"name": "test-cluster", "uid": "3134ac35-492b-11ed-94b1-0255ac1002cd", "annotations": {"jobid": "31557172-492b-11ed-94b1-0255ac1002cd", "resourceJobId": "31367b5c-492b-11ed-94b1-0255ac1002cd"}, "creationTimestamp": "2022-10-11 06:08:57.631041168 +0000 UTC", "updateTimestamp": "2022-10-11 06:08:57.63104138 +0000 UTC"}, "spec": {"category": "CCE", "type": "VirtualMachine", "flavor": "cce.s1.small", "version": "v1.21", "platformVersion": "cce.4.10", "hostNetwork": {"vpc": "600b8e93-fbaa-4119-87c2-87f0678dd189", "subnet": "2bfaefa7-bf01-4798-9c5c-a29fe989a24b"}, "containerNetwork": {"mode": "vpc-router", "cidr": "10.0.0.0/16", "cidrs": [{"cidr": "10.0.0.0/16"}]}, "eniNetwork": {}, "authentication": {"mode": "rbac", "authenticatingProxy": {}}, "billingMode": 0, "kubernetesSvcIpRange": "10.247.0.0/16", "kubeProxyMode": "iptables", "extendParam": {"orderID": ""}}, "status": {"phase": "Creating", "jobID": "31557172-492b-11ed-94b1-0255ac1002cd"}} 获取到当前项目下的集群信息为:{"kind": "Cluster", "apiVersion": "v3", "items": [{"kind": "Cluster", "apiVersion": "v3", "metadata": {"name": "test-cluster", "uid": "3134ac35-492b-11ed-94b1-0255ac1002cd", "annotations": {"activeNodesNumber": "0", "faultNodesNumber": "0", "installedAddonInstances": "[{\"addonTemplateName\":\"everest\",\"version\":\"1.3.17\",\"status\":\"installing\"},{\"addonTemplateName\":\"coredns\",\"version\":\"1.23.1\",\"status\":\"installing\"}]", "totalNodesCPU": "0", "totalNodesMemory": "0", "totalNodesNumber": "0"}, "labels": {"FeatureGates": "elbv3,"}, "creationTimestamp": "2022-10-11 06:08:57.631041 +0000 UTC", "updateTimestamp": "2022-10-11 06:14:01.876433 +0000 UTC"}, "spec": {"category": "CCE", "type": "VirtualMachine", "flavor": "cce.s1.small", "version": "v1.21", "platformVersion": "cce.4.10", "hostNetwork": {"vpc": "600b8e93-fbaa-4119-87c2-87f0678dd189", "subnet": "2bfaefa7-bf01-4798-9c5c-a29fe989a24b", "SecurityGroup": "a1ccd90a-c622-4060-a243-c6b59035bec0"}, "containerNetwork": {"mode": "vpc-router", "cidr": "10.0.0.0/16"}, "eniNetwork": {}, "authentication": {"mode": "rbac", "authenticatingProxy": {}}, "billingMode": 0, "masters": [{"availabilityZone": "cn-east-3a"}], "kubernetesSvcIpRange": "10.247.0.0/16", "kubeProxyMode": "iptables", "az": "cn-east-3a", "extendParam": {"alpha.cce/fixPoolMask": "", "kubernetes.io/cpuManagerPolicy": "", "upgradefrom": ""}, "supportIstio": true}, "status": {"phase": "Available", "endpoints": [{"url": "https://192.168.0.4:5443", "type": "Internal"}]}}]}cce.cluster.yaml:#https://apiexplorer.developer.huaweicloud.com/apiexplorer/doc kind: Cluster apiVersion: v3 metadata: name: chinaskillscce2022 annotations: cluster.install.addons.external/install: '[{"addonTemplateName":"icagent"}]' spec: category: CCE flavor: cce.s2.small version: v1.21 hostNetWork: vpc: eb35f318-0cdb-4632-a068-414c2285a409 subnet: 0b51072e-0225-4f30-934e-106f684ca67a containerNetWork: mode: vpc-router cidr: 10.10.0.0/16 kubernetesSvcIpRange: 10.247.0.0/16 description: '' billingMode: 0 extendParam: kubeProxyMode: iptables alpha.cce/fixPoolMask: '25' authentication: mode: rbac ipv6enable: false2. ECS云主机管理的命令行工具开发使用已建好的运维开发环境,在/root/目录下创建ecs_manager.py脚本,完成ECS云主机管理,ecs_manager.py程序支持命令行参数执行。提示说明:华为云主机支持安装所需Python库,需安装所开发程序所依赖的Python库。(1)程序支持根据命令行参数,创建1个云主机。创建待成功,再返回查询该云主机的信息,结果以Json格式输出到控制台。参考执行实例如下:python3 ecs_manager.py create --input '{ "name": " chinaskill001", "imagename": "CentOS 7.9 64bit"}'位置参数“create”,表示创建;参数“-i或–input”,格式为Json格式文本的云主机的名称、镜像名称2个信息。其他参数同上述开发环境云主机一致。(2)支持查询给定具体名称的ECS云主机查询。参考执行实例如下:python3 ecs_manager.py get --name chinaskill001-o chinaskill001.json位置参数“get”,表示查询ECS;参数“-n或–name”支持指定名称ECS查询,类型为string。参数“-o或–output”支持查询该ECS信息输出到文件,格式为Json格式。(3)程序支持查询目前区域账号下所有的ECS云主机。参考执行实例如下:python3 ecs_manager.py getall -o huawei_all_ecs.yaml位置参数“getall”,表示查询所有ECS云主机;参数“-o 或–output”支持输出到文件,格式为yaml格式。(4)支持删除指定的名称的云主机。参考执行实例如下:python3 ecs_manager.py delete --name chinaskill001位置参数“delete”,表示删除一个ECS云主机;返回response,通过控制台输出。参数“-n或–name”支持指定名称查询,类型为string。ces_create.py:# =========================================== # Copyright Jiangsu One Cloud Technology Development Co. LTD. All Rights Reserved. # 版权: 江苏一道云科技发展有限公司,版权所有! # =========================================== # coding: utf-8 from http import client import json from pydoc import cli from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkecs.v2.region.ecs_region import EcsRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkecs.v2 import * import time from huawei_ecs_server import get_server_id #Token def get_aksk_v3_ecs_token(): ak = "8MJITOJBPKNUTADFGCUA" sk = "yehuP3rojiH0ucj1pnCev3VawVd4VwxDr1mCWLRh" token = BasicCredentials(ak,sk) client = EcsClient.new_builder().\ with_credentials(token).\ with_region(EcsRegion.value_of("cn-east-3")).build() return client class server_manager: def __init__(self,client): self.client = client def create_server(self,name,imagename): client = self.client request = CreateServersRequest() listPrePaidServerSecurityGroupSecurityGroupsServer = [ PrePaidServerSecurityGroup( id="b46f7f8c-5e1d-4e85-91c6-1ee43ce7c9a5" ) ] listPrePaidServerDataVolumeDataVolumesServer = [ PrePaidServerDataVolume( volumetype="SSD", size=50 ) ] rootVolumePrePaidServerRootVolume = PrePaidServerRootVolume( volumetype="SSD", size=100 ) bandwidthPrePaidServerEipBandwidth = PrePaidServerEipBandwidth( size=10, sharetype="PER" ) eipPrePaidServerEip = PrePaidServerEip( iptype="5_bgp", bandwidth=bandwidthPrePaidServerEipBandwidth ) publicipPrePaidServerPublicip = PrePaidServerPublicip( eip=eipPrePaidServerEip, delete_on_termination=True ) listPrePaidServerNicNicsServer = [ PrePaidServerNic( subnet_id="2bfaefa7-bf01-4798-9c5c-a29fe989a24b" ) ] serverPrePaidServer = PrePaidServer( image_ref=imagename, flavor_ref="c7.xlarge.2", name=name, vpcid="600b8e93-fbaa-4119-87c2-87f0678dd189", nics=listPrePaidServerNicNicsServer, publicip=publicipPrePaidServerPublicip, root_volume=rootVolumePrePaidServerRootVolume, data_volumes=listPrePaidServerDataVolumeDataVolumesServer, security_groups=listPrePaidServerSecurityGroupSecurityGroupsServer, ) request.body = CreateServersRequestBody( server=serverPrePaidServer ) response = client.create_servers(request) # time.sleep(10) print(f"创建的云服务器信息为:{response}") return response def get_server_id(self,name): client = self.client req = ListServersDetailsRequest() resp = client.list_servers_details(req) for server in resp.servers: if server.name == name: return server.id def get_server_detail(self,name): client = self.client req = ListServersDetailsRequest() resp = client.list_servers_details(req) strins = str(resp) return strins def getall_ecs(self): client = self.client req = ListServersDetailsRequest() resp = client.list_servers_details(req) strings = str(resp) return strings def get_server(self,id): client = self.client req = ShowServerRequest() req.server_id = id resp = client.show_server(req) print(f"获取到的云服务器信息为:{resp}") return resp def delete_server(self,name): client = self.client request = DeleteServersRequest() listServersbody = [ ServerId( id=get_server_id(name) ) ] request.body = DeleteServersRequestBody( servers=listServersbody ) response = client.delete_servers(request) return response if __name__ == "__main__": server_m = server_manager(get_aksk_v3_ecs_token()) # create # create_servers = server_m.create_server("chinaskill","f025bf3e-3173-4f2a-8f59-34aca5bd853d") #detail # list_details = server_m.get_server_detail("chinaskill001","chinaskill001.json") # id # id = server_m.get_server_id("chinaskill") # print(f"云服务器的ID为:{id}") # time.sleep(15) # get # show_server = server_m.get_server(id) # time.sleep(20) # delete delete_servers = server_m.delete_server("chinaskill")ecs_manager.py:# =========================================== # Copyright Jiangsu One Cloud Technology Development Co. LTD. All Rights Reserved. # 版权: 江苏一道云科技发展有限公司,版权所有! # =========================================== #encoding:utf-8 # coding: utf-8 #encoding:utf-8 import argparse from ast import arg from cgi import print_arguments from cgitb import reset import json,yaml import ces_create # get all user print("-----------begin-----------------") ecs_m = ces_create.server_manager(ces_create.get_aksk_v3_ecs_token()) def define_args(parser): """ 定义程序支持的args :return: """ # parser = argparse.ArgumentParser() #增加控制命令(postion 位置参数,必须) parser.add_argument('command', help='Resource command name', type=str) # parser.add_argument('delete', # help='delete a resource', # type=str) #可选参数(可有可无) parser.add_argument('-n', '--name', # 可选参数,删除的名称 help='The Name of the resource', # 输入-h展示 type=str) parser.add_argument('-i', '--input', # 可选参数,删除的名称 help='The input json format text ', # 输入-h展示 type=str) parser.add_argument('-o', '--output', # 可选参数,删除的名称 help='The output file path ', # 输入-h展示 type=str) def parse_args(parser): args = parser.parse_args() # print(args) # print('Provided name value is %r.' % args.command) # print('Provided name value is %r.' % args.name) if args.command: if args.command == "create": print("create Cloud ECSserver") create_ecs(args) elif args.command == "getall": print("Get All ECSserver") getall_ecs(args) elif args.command == "get": print("Get ECSserver") get_ecs(args) elif args.command == "delete": print("Delete ECSserver") delete_ecs(args) else: print("Note support command name!") def create_ecs(args): print('Provided command value is %r.' % args.command) print('Provided input value is %r.' % args.input) # print('Provided output value is %r.' % args.output)\ ecs_dict = json.loads(args.input) print(ecs_dict) res = ecs_m.create_server(ecs_dict["name"],ecs_dict["imagename"]) print(res) def get_ecs(args): print('Provided command value is %r.' % args.command) print('Provided input value is %r.' % args.input) print('Provided output value is %r.' % args.output) result = ecs_m.get_server_detail(args.name) output_file = args.output with open(output_file, 'w') as jsonfile: json.dump(result, jsonfile, indent=4) print(result) def getall_ecs(args): print('Provided command value is %r.' % args.command) print('Provided input value is %r.' % args.input) print('Provided output value is %r.' % args.output) result = ecs_m.getall_ecs() print(result) output_file = args.output configuration = json.loads(result) with open(output_file,"w")as yamlfile: yaml.dump(configuration,yamlfile) print(result) def delete_ecs(args): print('Provided command value is %r.' % args.command) print('Provided input value is %r.' % args.input) print('Provided output value is %r.' % args.output) result = ecs_m.delete_server() print(result) if __name__ == '__main__': parser = argparse.ArgumentParser() define_args(parser) parse_args(parser)3. ECS云主机管理与监控的Restful APIs HTTP服务封装云服务器的/root/目录下编写huawei_ecs_server.py文件编写Python程序,实现华为ECS云主机管理与云主机操作系统性能远程监控。所有的资源申请区域为“华北-北京四”,所有服务封装成Restful APIs方式,host为127.0.0.1,端口8888,供外部检测。提示说明:华为云主机支持安装所需Python库,需安装程序所依赖的Python库。具体要求:(1)POST /ecs/server 创建云主机,需要等待成功该云主机后,返回查询该云主机信息。request传输的数据为application/json,Json包含2个必备信息,名称、镜像名称。Json数据格式案例如下:{ "name": " cloud001", "imagename": "CentOS 7.9 64bit"}其他必备参数与开发环境云主机一致。Response的Body以Json格式,返回所创建成功的主机详细信息。(2)GET /ecs/server/{name}查询云主机;Response的Body以yaml格式。GET /ecs/server/{name}/os查询所指定ID云主机的操作系统信息;Response的Json格式返回。返回格式要求如下:os_release:操作系统的版本系统。cpu_util:CPU使用率%。mem_util:内存使用率%。disk_util:磁盘使用率%。(3)DELETE /ecs/server/{name}删除云主机;Response的Body以Json格式。os_remote_monitor.py:# =========================================== # Copyright Jiangsu One Cloud Technology Development Co. LTD. All Rights Reserved. # 版权: 江苏一道云科技发展有限公司,版权所有! # =========================================== import os import paramiko # coding: utf-8 from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkecs.v2.region.ecs_region import EcsRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkecs.v2 import * # uname、hostname、cpu_util、mem_util、ip_address; def create_remote_client(ip, port, name, pwd, timeout=30): client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # 连接 try: client.connect(ip, port, name, pwd) print('----------连接成功-----------------') except: print("----------连接失败-----------------") return client # 实时读取 def run_ssh_command(ssh_client, cmd): try: stdin, stdout, stderr = ssh_client.exec_command(cmd, get_pty=True) #strip \n\r return stdout.read().decode() except Exception as e: print("execute command %s error, error message is %s" % (cmd, e)) def getos_uname(client): return run_ssh_command(client, "cat /etc/redhat-release").strip() # return run_ssh_command(client, "cat /etc/redhat-release") def getos_hostname(client): return run_ssh_command(client, "hostname").strip() def getos_cpu_util(client): command_name = "vmstat 1 1|sed '1d'|sed '1d'|awk '{print $15}'" # https: // blog.csdn.net / qq_37275405 / article / details / 119210527 result = run_ssh_command(client, command_name).strip() return result + '%' # 3次平均值 # cpu = "vmstat 1 3|sed '1d'|sed '1d'|awk '{print $15}'" # stdin, stdout, stderr = ssh.exec_command(cpu) # cpu = stdout.readlines() # cpu_usage = str(round((100 - (int(cpu[0]) + int(cpu[1]) + int(cpu[2])) / 3), 2)) + '%‘ import pstats def getos_mem_util(client): # free | sed -n '2,2p'| awk '{print $2}' line and collumn command = "cat /proc/meminfo|sed -n '1,4p'|awk '{print $2}'" # [root @ ecs - 1049 ~] # cat /proc/meminfo|sed -n '1,4p'|awk '{print $2}' # MemTotal: 3754864 # MemFree: 3136028 # MemAvailable: 3326468 # Buffers: 28172 # 3754864 # 3135860 # 3326272 # 28140 result = run_ssh_command(client, command) mem = result.split("\r\n") mem_total = round(int(mem[0]) / 1024) mem_total_free = round(int(mem[1]) / 1024) mem_usage = str(round(((mem_total - mem_total_free) / mem_total) * 100, 2)) + "%" return mem_usage def getos_ip_address(client): result = run_ssh_command(client, "hostname -I") return result.strip() def getos_disk_util(client): result = run_ssh_command(client, "df -h / | sed -n '2,2p' | awk '{print $5}'") return result.strip() def getos_info(client): uname = getos_uname(client) hostname = getos_hostname(client) cpu_util = getos_cpu_util(client) mem_util = getos_mem_util(client) ip_addr = getos_ip_address(client) disk_util = getos_disk_util(client) osinfo = { "os_release": uname, "hostname": hostname, "cpu_util": cpu_util, "mem_util": mem_util, "ip_addr": ip_addr, "disk_util": disk_util } import json json_str = json.dumps(osinfo, indent=4) return json_str def get_remote_server_os_info(ip, port, user, password): client = create_remote_client(ip, port, user, password) os_info = getos_info(client) return os_info if __name__ == '__main__': os_info = get_remote_server_os_info("124.71.205.227",22,"root","Abc@1234") print(os_info) # 3.linux查看版本当前操作系统发行信息 cat /etc/issue 或 cat /etc/centos-release # https://blog.csdn.net/qq_37275405/article/details/119210527 # [root@ecs-1049 ~]# df -h / # Filesystem Size Used Avail Use% Mounted on # /dev/sda1 40G 2.2G 36G 6% / # command = "df -h / | sed -n "2,2p" | awk '{print $5}'" # [root@ecs-1049 ~]# df -h / | sed -n "2,2p" | awk '{print $5}' # 6% # ----------连接成功----------------- # { # "os_release": "CentOS Linux release 7.9.2009 (Core)", # "hostname": "ecs-1049", # "cpu_util": "99%", # "mem_util": "10.91%", # "ip_addr": "192.168.0.238", # "disk_util": "6%" # } # # Process finished with exit code 0huawei_ecs_server.py:# =========================================== # Copyright Jiangsu One Cloud Technology Development Co. LTD. All Rights Reserved. # 版权: 江苏一道云科技发展有限公司,版权所有! # =========================================== import json import flask from flask import request, jsonify, Response from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkecs.v2.region.ecs_region import EcsRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkecs.v2 import * from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkecs.v2.region.ecs_region import EcsRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkecs.v2 import * from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkecs.v2.region.ecs_region import EcsRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkecs.v2 import * import requests # careful not to mix flask's request with requests! import threading import yaml # create flask PORT = 8888 app = flask.Flask(__name__) @app.route('/ecs/server', methods=['POST']) def create_server(): args = request.args print(request.method) content = request.get_data(as_text=True) print(content) return Response(yaml.dump(content), mimetype='application/yaml') def show_server(id): ak = "DQVNQ7NHZCRS9XFCJAME" sk = "jGYmdH66dfittUCEnlr4s9gJjb6xxN4P3tuyPl4j" credentials = BasicCredentials(ak, sk) client = EcsClient.new_builder().with_credentials(credentials)\ .with_region(EcsRegion.value_of("cn-north-4")).build() try: request = ShowServerRequest() request.server_id = id response = client.show_server(request) return response except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) def get_ipaddress(id): ak = "DQVNQ7NHZCRS9XFCJAME" sk = "jGYmdH66dfittUCEnlr4s9gJjb6xxN4P3tuyPl4j" credentials = BasicCredentials(ak, sk) \ client = EcsClient.new_builder() \ .with_credentials(credentials) \ .with_region(EcsRegion.value_of("cn-north-4")) \ .build() try: request = ListServerInterfacesRequest() request.server_id = id response = client.list_server_interfaces(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) def get_server_id(name): ak = "DQVNQ7NHZCRS9XFCJAME" sk = "jGYmdH66dfittUCEnlr4s9gJjb6xxN4P3tuyPl4j" credentials = BasicCredentials(ak, sk) \ client = EcsClient.new_builder() \ .with_credentials(credentials) \ .with_region(EcsRegion.value_of("cn-north-4")) \ .build() try: request = ListServersDetailsRequest() response = client.list_servers_details(request) print(response.servers) for server in response.servers: if server.name == name: return server.id except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) # 路由 方法 @app.route('/ecs/server/<name>', methods=['GET']) def get_server(name): print(name) id = get_server_id(name) print(id) if id: # id = "523d290d-42fa-42cd-9cfc-cafde8707ce5" data = show_server(id) # print(data) #json数据直接返回 return json.loads(str(data)) #如果yaml返回 # return Response(yaml.dump(data), mimetype='application/yaml') else: return "Not Exist!" @app.route('/ecs/server/<name>', methods=['DELETE']) def delete_server(name): if name: id = get_server_id(name) def delete_server(id_info): ak = "DQVNQ7NHZCRS9XFCJAME" sk = "jGYmdH66dfittUCEnlr4s9gJjb6xxN4P3tuyPl4j" credentials = BasicCredentials(ak, sk) \ client = EcsClient.new_builder() \ .with_credentials(credentials) \ .with_region(EcsRegion.value_of("cn-north-4")) \ .build() try: request = DeleteServersRequest() listServersbody = [ ServerId( id=id_info ) ] request.body = DeleteServersRequestBody( servers=listServersbody ) response = client.delete_servers(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) import os_remote_monitor @app.route('/ecs/server/<name>/os', methods=['GET']) def get_server_os(name): if name: id = get_server_id(name) if id: ip = get_server_ip(id) return os_remote_monitor.get_remote_server_os_info(ip,22,"root","Cloud2022") else: return {} # coding: utf-8 def get_server_ip(id): ak = "DQVNQ7NHZCRS9XFCJAME" sk = "jGYmdH66dfittUCEnlr4s9gJjb6xxN4P3tuyPl4j" credentials = BasicCredentials(ak, sk) \ client = EcsClient.new_builder() \ .with_credentials(credentials) \ .with_region(EcsRegion.value_of("cn-north-4")) \ .build() try: request = ShowServerRequest() request.server_id = id response = client.show_server(request) #list ips = list(response.server.addresses.values())[0] for ip in ips: if ip.os_ext_ip_stype == "floating": return ip.addr except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) if __name__ == "__main__": app.run(host='localhost', port='8888' , debug=True, use_reloader=True) ---------------------------------执行结果----------------------------------------- [{"status": "ACTIVE", "updated": "2022-10-11T07:22:43Z", "auto_terminate_time": "", "hostId": "02165bdab1b973b122477b3a2312960a69ec9c2a8705f0537fbd581b", "OS-EXT-SRV-ATTR:host": "2165bdab1b973b122477b3a2312960a69ec9c2a8705f0537fbd581b", "addresses": {"600b8e93-fbaa-4119-87c2-87f0678dd189": [{"version": "4", "addr": "192.168.0.121", "OS-EXT-IPS:type": "fixed", "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:39:90:0a", "OS-EXT-IPS:port_id": "094b325b-6e0a-4161-937f-f6bb3f60bee3"}, {"version": "4", "addr": "124.71.205.227", "OS-EXT-IPS:type": "floating", "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:39:90:0a", "OS-EXT-IPS:port_id": "094b325b-6e0a-4161-937f-f6bb3f60bee3"}]}, "image": {"id": "f025bf3e-3173-4f2a-8f59-34aca5bd853d"}, "OS-EXT-STS:vm_state": "active", "OS-EXT-SRV-ATTR:instance_name": "instance-00da7649", "OS-EXT-SRV-ATTR:hypervisor_hostname": "2165bdab1b973b122477b3a2312960a69ec9c2a8705f0537fbd581b", "flavor": {"id": "c7.large.2", "name": "c7.large.2", "disk": "0", "vcpus": "2", "ram": "4096"}, "id": "d7747398-377b-4292-8529-20f62df56d82", "security_groups": [{"name": "Sys-FullAccess", "id": "b46f7f8c-5e1d-4e85-91c6-1ee43ce7c9a5"}], "OS-EXT-AZ:availability_zone": "cn-east-3a", "user_id": "e93823c6ea3d45429b3173aea1acdc8b", "name": "ecs-e364", "created": "2022-10-11T07:22:04Z", "tenant_id": "1ac80630a2494ca7bb05a7e0ebd82862", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "config_drive": "", "metadata": {"image_name": "CentOS 7.9 64bit", "metering.resourcespeccode": "c7.large.2.linux", "charging_mode": "0", "vpc_id": "600b8e93-fbaa-4119-87c2-87f0678dd189", "os_type": "Linux", "metering.resourcetype": "1", "metering.image_id": "f025bf3e-3173-4f2a-8f59-34aca5bd853d", "os_bit": "64", "__support_agent_list": "hss,ces", "cascaded.instance_extrainfo": "pcibridge:1", "metering.imagetype": "gold"}, "OS-SRV-USG:launched_at": "2022-10-11T07:22:20.000000", "os-extended-volumes:volumes_attached": [{"id": "a2dc099c-1bc9-44bf-9496-6027a75f8091", "delete_on_termination": "true", "bootIndex": "0", "device": "/dev/sda"}], "description": "", "host_status": "UP", "OS-EXT-SRV-ATTR:hostname": "ecs-e364", "OS-EXT-SRV-ATTR:reservation_id": "r-flhxwpqc", "OS-EXT-SRV-ATTR:launch_index": 0, "OS-EXT-SRV-ATTR:kernel_id": "", "OS-EXT-SRV-ATTR:ramdisk_id": "", "OS-EXT-SRV-ATTR:root_device_name": "/dev/sda", "OS-EXT-SRV-ATTR:user_data": "IyEvYmluL2Jhc2gKZWNobyAncm9vdDokNiRQQ3pDUUVaNSRJUzFIbE5JbFBJN2VEUGg2WEpNNjJKTHcuclFpOG0uL1EvWUdNQUdKVjhsR2c3VmZ5VWhKTTRpcXpXVXI1MTBUVzROSnZoT2ZnRHlva0suMTdQZTNlLycgfCBjaHBhc3N3ZCAtZTs=", "locked": false, "tags": [], "os:scheduler_hints": {}, "enterprise_project_id": "0", "sys_tags": [{"key": "_sys_enterprise_project_id", "value": "0"}], "cpu_options": {}}] d7747398-377b-4292-8529-20f62df56d82 {"server": {"status": "ACTIVE", "updated": "2022-10-11T07:22:43Z", "auto_terminate_time": "",
-
将mongodb-linux-x86_64-4.0.4.tgz复制到chinaskill-sql-1和chinaskill-sql-2 [root@chinaskill-sql-1 ~]# tar -zxf mongodb-linux-x86_64-4.0.4.tgz -C /usr/local [root@chinaskill-sql-1 ~]# cd /usr/local [root@chinaskill-sql-1 local]# mv mongodb-linux-x86_64-4.0.4/ mongodb [root@chinaskill-sql-1 local]# vi /etc/profile export PATH=$PATH:/usr/local/mongodb/bin [root@chinaskill-sql-1 local]# source /etc/profile [root@chinaskill-sql-1 local]# mkdir -p /data/db [root@chinaskill-sql-1 local]# mongo --version [root@chinaskill-sql-2 ~]# tar -zxf mongodb-linux-x86_64-4.0.4.tgz -C /usr/local [root@chinaskill-sql-2 ~]# cd /usr/local [root@chinaskill-sql-2 local]# mv mongodb-linux-x86_64-4.0.4/ mongodb [root@chinaskill-sql-2 local]# vi /etc/profile export PATH=$PATH:/usr/local/mongodb/bin [root@chinaskill-sql-2 local]# source /etc/profile [root@chinaskill-sql-2 local]# mkdir -p /data/db [root@chinaskill-sql-2 local]# mongo --version 将mongodb-linux-x86_64-4.0.4.tgz复制到chinaskill-sql-1和chinaskill-sql-2 [root@chinaskill-sql-1 ~]# tar -zxf mongodb-linux-x86_64-4.0.4.tgz -C /usr/local [root@chinaskill-sql-1 ~]# cd /usr/local [root@chinaskill-sql-1 local]# mv mongodb-linux-x86_64-4.0.4/ mongodb [root@chinaskill-sql-1 local]# vi /etc/profile export PATH=$PATH:/usr/local/mongodb/bin [root@chinaskill-sql-1 local]# source /etc/profile [root@chinaskill-sql-1 local]# mkdir -p /data/db [root@chinaskill-sql-1 local]# mongo --version [root@chinaskill-sql-2 ~]# tar -zxf mongodb-linux-x86_64-4.0.4.tgz -C /usr/local [root@chinaskill-sql-2 ~]# cd /usr/local [root@chinaskill-sql-2 local]# mv mongodb-linux-x86_64-4.0.4/ mongodb [root@chinaskill-sql-2 local]# vi /etc/profile export PATH=$PATH:/usr/local/mongodb/bin [root@chinaskill-sql-2 local]# source /etc/profile [root@chinaskill-sql-2 local]# mkdir -p /data/db [root@chinaskill-sql-2 local]# mongo --version 将mongodb-linux-x86_64-4.0.4.tgz复制到chinaskill-sql-1和chinaskill-sql-2 [root@chinaskill-sql-1 ~]# tar -zxf mongodb-linux-x86_64-4.0.4.tgz -C /usr/local [root@chinaskill-sql-1 ~]# cd /usr/local [root@chinaskill-sql-1 local]# mv mongodb-linux-x86_64-4.0.4/ mongodb [root@chinaskill-sql-1 local]# vi /etc/profile export PATH=$PATH:/usr/local/mongodb/bin [root@chinaskill-sql-1 local]# source /etc/profile [root@chinaskill-sql-1 local]# mkdir -p /data/db [root@chinaskill-sql-1 local]# mongo --version [root@chinaskill-sql-2 ~]# tar -zxf mongodb-linux-x86_64-4.0.4.tgz -C /usr/local [root@chinaskill-sql-2 ~]# cd /usr/local [root@chinaskill-sql-2 local]# mv mongodb-linux-x86_64-4.0.4/ mongodb [root@chinaskill-sql-2 local]# vi /etc/profile export PATH=$PATH:/usr/local/mongodb/bin [root@chinaskill-sql-2 local]# source /etc/profile [root@chinaskill-sql-2 local]# mkdir -p /data/db [root@chinaskill-sql-2 local]# mongo --version [root@chinaskill-sql-1 local]# vi /usr/local/mongodb/mongod.conf bind_ip=0.0.0.0 replSet=rs [root@chinaskill-sql-1 local]# mongod -f /usr/local/mongodb/mongod.conf & [root@chinaskill-sql-2 local]# vi /usr/local/mongodb/mongod.conf bind_ip=0.0.0.0 replSet=rs [root@chinaskill-sql-2 local]# mongod -f /usr/local/mongodb/mongod.conf & [root@chinaskill-sql-1 local]# mongo > rs.status() { "operationTime" : Timestamp(0, 0), "ok" : 0, "errmsg" : "no replset config has been received", "code" : 94, "codeName" : "NotYetInitialized", "$clusterTime" : { "clusterTime" : Timestamp(0, 0), "signature" : { "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) } } } > var config={_id:"rs",members:[{_id:0,host:"172.16.2.76:27017"},{_id:1,host:"172.16.2.45:27017"}]} > rs.initiate(config) …… rs:PRIMARY> rs.status() { "set" : "rs", "date" : ISODate("2022-09-08T06:49:13.414Z"), "myState" : 1, "term" : NumberLong(1), "syncingTo" : "", "syncSourceHost" : "", "syncSourceId" : -1, "heartbeatIntervalMillis" : NumberLong(2000), "optimes" : { "lastCommittedOpTime" : { "ts" : Timestamp(1662619748, 1), "t" : NumberLong(1) }, "readConcernMajorityOpTime" : { "ts" : Timestamp(1662619748, 1), "t" : NumberLong(1) }, "appliedOpTime" : { "ts" : Timestamp(1662619748, 1), "t" : NumberLong(1) }, "durableOpTime" : { "ts" : Timestamp(1662619748, 1), "t" : NumberLong(1) } }, "lastStableCheckpointTimestamp" : Timestamp(1662619698, 1), "members" : [ { "_id" : 0, "name" : "172.16.2.76:27017", "health" : 1, "state" : 1, "stateStr" : "PRIMARY", "uptime" : 284, "optime" : { "ts" : Timestamp(1662619748, 1), "t" : NumberLong(1) }, "optimeDate" : ISODate("2022-09-08T06:49:08Z"), "syncingTo" : "", "syncSourceHost" : "", "syncSourceId" : -1, "infoMessage" : "could not find member to sync from", "electionTime" : Timestamp(1662619696, 1), "electionDate" : ISODate("2022-09-08T06:48:16Z"), "configVersion" : 1, "self" : true, "lastHeartbeatMessage" : "" }, { "_id" : 1, "name" : "172.16.2.45:27017", "health" : 1, "state" : 2, "stateStr" : "SECONDARY", "uptime" : 68, "optime" : { "ts" : Timestamp(1662619748, 1), "t" : NumberLong(1) }, "optimeDurable" : { "ts" : Timestamp(1662619748, 1), "t" : NumberLong(1) }, "optimeDate" : ISODate("2022-09-08T06:49:08Z"), "optimeDurableDate" : ISODate("2022-09-08T06:49:08Z"), "lastHeartbeat" : ISODate("2022-09-08T06:49:12.328Z"), "lastHeartbeatRecv" : ISODate("2022-09-08T06:49:12.582Z"), "pingMs" : NumberLong(0), "lastHeartbeatMessage" : "", "syncingTo" : "172.16.2.76:27017", "syncSourceHost" : "172.16.2.76:27017", "syncSourceId" : 0, "infoMessage" : "", "configVersion" : 1 } ], "ok" : 1, "operationTime" : Timestamp(1662619748, 1), "$clusterTime" : { "clusterTime" : Timestamp(1662619748, 1), "signature" : { "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) } } } rs:PRIMARY> exit bye [root@chinaskill-node-1 ~]# mkdir /usr/local/nodejs [root@chinaskill-node-1 ~]# tar -Jxf node-v12.16.1-linux-x64.tar.xz -C /usr/local/nodejs [root@chinaskill-node-1 ~]# vi /etc/profile export NODE_PATH=/usr/local/nodejs/node-v12.16.1-linux-x64 export PATH=$PATH:$NODE_PATH/bin [root@chinaskill-node-1 ~]# source /etc/profile [root@chinaskill-node-1 ~]# node -v v12.16.1 [root@chinaskill-node-1 ~]# yum install gcc-c++ [root@chinaskill-node-1 ~]# yum groupinstall 'Development Tools' [root@chinaskill-node-1 ~]# tar -zxf rocket.chat.tgz -C /tmp [root@chinaskill-node-1 ~]# cd /tmp/bundle/programs/server [root@chinaskill-node-1 server]# npm install [root@chinaskill-node-1 server]# mv /tmp/bundle /opt/Rocket.Chat [root@chinaskill-node-1 server]# cd /opt/Rocket.Chat/ [root@chinaskill-node-1 Rocket.Chat]# useradd -M rocketchat [root@chinaskill-node-1 Rocket.Chat]# usermod -L rocketchat [root@chinaskill-node-1 Rocket.Chat]# chown -R rocketchat:rocketchat /opt/Rocket.Chat [root@chinaskill-node-1 Rocket.Chat]# vi /lib/systemd/system/rocketchat.service [Unit] Description=The Rocket.Chat server running on Linux After=network.target remote-fs.target nss-lookup.target nginx.service mongod.service [Service] ExecStart=/usr/local/nodejs/node-v12.16.1-linux-x64/bin/node /opt/Rocket.Chat/main.js StandardOutput=syslog StandardError=syslog SyslogIdentifier=rocketchat User=rocketchat Environment=ROOT_URL=http://localhost:3000 Environment=PORT=3000 Environment=MONGO_URL=mongodb://172.16.2.76:27017/rocketchat?replicaSet=rs Environment=MONGO_OPLOG_URL=mongodb://172.16.2.76:27017/local?replicaSet=rs [Install] WantedBy=multi-user.target [root@chinaskill-node-1 Rocket.Chat]# systemctl enable rocketchat [root@chinaskill-node-1 Rocket.Chat]# systemctl start rocketchat [root@chinaskill-node-1 Rocket.Chat]# systemctl status rocketchat ● rocketchat.service - The Rocket.Chat server running on Linux Loaded: loaded (/usr/lib/systemd/system/rocketchat.service; enabled; vendor preset: disabled) Active: active (running) since Thu 2022-09-08 15:14:40 CST; 6s ago Main PID: 9168 (node) CGroup: /system.slice/rocketchat.service └─9168 /usr/local/nodejs/node-v12.16.1-linux-x64/bin/node /opt/Rocket.Chat/main.js Sep 08 15:14:40 chinaskill-node-1 systemd[1]: Started The Rocket.Chat server running on Linux. [root@chinaskill-sql-1 local]# mongo rs:PRIMARY> show dbs admin 0.000GB config 0.000GB local 0.001GB rocketchat 0.002GB rs:PRIMARY> use rocketchat switched to db rocketchat rs:PRIMARY> show collections …… [root@chinaskill-sql-2 local]# mongo rs:SECONDARY> db.getMongo().setSlaveOk() rs:SECONDARY> show dbs admin 0.000GB config 0.000GB local 0.001GB rocketchat 0.002GB rs:SECONDARY> exit bye http://121.37.137.27:3000 tar -zxvf rocketchat-cloud.tar.gz -C /opt vim /etc/yum.repos.d/yum.repo[local]name=loaclbaseurl=file:///opt/yum.repogpgcheck=0enabled=1 yum install -y mongodb-org mongo --version systemctl enable mongod --now 【题目4】 1.配置mongodb文件 vim /etc/mongodb.conf...#network interfaces net: port: 27017 bindip: 127.0.0.1 #这里bindip改为0.0.0.0 (为了更好初始化)...#replication: replication: replSetName: rs #设置集群名称 2.对集群进行初始化 mongo #进入命令行 (进行初始化的配置)...#可以首先创建一个json格式的变量数据> var rs_conf={"_id":"rs","members":[{"_id":0,"host":"172.16.1.125:27017"}, {"_id":1,"host":"172.16.1.7:27017"}]} #eth0的网卡地址 #根据如上定以对rs集群进行初始化> rs.initiate(rs_conf) #显示如下即为成功["ok : 1"] 3.查看集群状态 rs:SECONDARY> rs.status() 【题目5】 1 yum源安装 yum install -y nodejs node --version 【题目7】上云 1.解压rocketchat压缩包到缓存目录/tmp tar xvf rocket.chat.tgz -C /tmp/ 2 安装依赖 yum install -y gcc-c++ make GraphicsMagick 3.安装npm依赖 #设置一个国内npm源npm config set registry https://registry.npmmirror.com/npm config set ELECTRON_MIRROR https://cdn.npmmirror.com/dist/electron/ #安装依赖cd /tmp/bundle/programs/server && sudo npm install 5.将包移到指定目录,并创建rocket.chat用户管理改目录 mv /tmp/bundle /opt/Rocket.chatuseradd -M rocketchat && sudo usermod -L rocketchatchown -R rocketchat:rocketchat /opt/Rocket.chat 6配置rockerchat.service实现对其的管理,必要指定必要的环境。 cd /opt/Rocket.chat export MONGO_URL=mongodb://172.16.1.125:27017/rocketchat?replicaSet=rs #主节点ipexport MONGO_OPLOG_URL=mongodb://172.16.2.168:27017/local?replicaSet=rs #主节点ipexport ROOT_URL=http://172.16.2.59:3000/ #node节点ipexport PORT=3000 7.启动服务 cd /opt/Rocket.chat node main.js systemctl enable rocketchat && sudo systemctl start rocketchat 下载kubectl配置文件 mkdir -p $HOME/.kube 将kubeconfig.json复制到node节点 mv -f kubeconfig.json $HOME/.kube/config kubectl config use-context internal kubectl cluster-info kubectl get nodes 将helm-v3.3.0-linux-amd64.tar.gz上传到云主机 tar -zxf helm-v3.3.0-linux-amd64.tar.gz mv linux-amd64/helm /usr/local/bin helm version tar -zxf mychart-0.1.0.tgz cd mychart vi values.yaml service: type: NodePort helm package . helm install nginx mychart-0.1.0.tgz helm list helm uninstall nginx 将/root/mychart/mychart-0.1.0.tgz复制到本机 上传模板 安装模板 tar -zxf mariadb-7.3.14.tgz cd mariadb vi values.yaml service: ## Kubernetes service type, ClusterIP and NodePort are supported at present type: NodePort nodePort: master: 32334 rootUser: ## MariaDB admin password ## ref: https://github.com/bitnami/bitnami-docker-mariadb#setting-the-root-password-on-first-run ## password: "chinaskill" persistence: ## If true, use a Persistent Volume Claim, If false, use emptyDir ## enabled: false persistence: ## If true, use a Persistent Volume Claim, If false, use emptyDir ## enabled: false docker load -i bitnami_mariadb-10.3.22-debian-10-r27.tar helm install mariadb . 应用部署mriadb kubectl create ns mariadb mv mariadb mariadb10 tar -zxf mariadb-7.3.14.tgz cd mariadb vi values.yaml service: ## Kubernetes service type, ClusterIP and NodePort are supported at present type: NodePort db: ## MariaDB username and password ## ref: https://github.com/bitnami/bitnami-docker-mariadb#creating-a-database-user-on-first-run ## user: "chinaskillroot" password: "chinaskillpassword" ## Database to create ## ref: https://github.com/bitnami/bitnami-docker-mariadb#creating-a-database-on-first-run ## name: chinaskill persistence: ## If true, use a Persistent Volume Claim, If false, use emptyDir ## enabled: false persistence: ## If true, use a Persistent Volume Claim, If false, use emptyDir ## enabled: false helm install -n mariadb mariadb . helm list -A tar -zxf wordpress-13.0.23.tgz cd wordpress vi values.yaml service: ## @param service.type WordPress service type ## type: NodePort readinessProbe: enabled: false readinessProbe: enabled: false 查看persistence:配置 mariadb: persistence: enabled: false docker load -i bitnami_wordpress-5.9.2-debian-10-r0.tar docker load -i bitnami_mariadb-10.5.15-debian-10-r11.tar mkdir /wp chmod 777 /wp vi pv.yaml --- apiVersion: v1 kind: PersistentVolume metadata: name: pv-wp labels: name: pv-wp spec: capacity: storage: 10Gi accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Retain hostPath: path: /wp kubectl apply -f pv.yaml helm install wordpress . mkdir -p /data/charts chmod -R 777 /data/charts/ kubectl create ns chartmuseum vi chartmuseum.yaml --- apiVersion: apps/v1 kind: Deployment metadata: labels: app: chartmuseum name: chartmuseum namespace: chartmuseum spec: replicas: 1 selector: matchLabels: app: chartmuseum template: metadata: labels: app: chartmuseum spec: containers: - image: chartmuseum/chartmuseum:latest imagePullPolicy: IfNotPresent name: chartmuseum ports: - containerPort: 8080 protocol: TCP env: - name: DEBUG value: "1" - name: STORAGE value: local - name: STORAGE_LOCAL_ROOTDIR value: /charts volumeMounts: - mountPath: /charts name: charts-volume volumes: - name: charts-volume hostPath: path: /data/charts type: Directory --- apiVersion: v1 kind: Service metadata: name: chartmuseum namespace: chartmuseum spec: ports: - port: 8080 protocol: TCP targetPort: 8080 selector: app: chartmuseum kubectl apply -f chartmuseum.yaml kubectl get svc -n chartmuseum curl 10.106.178.78:8080 helm repo add chartmuseum http://10.106.178.78:8080 [root@master ~]# helm repo list NAME URL chartmuseum http://10.106.178.78:8080 [root@master ~]# curl --data-binary "@wordpress-13.0.23.tgz" http://10.106.178.78:8080/api/charts {"saved":true} [root@master ~]# curl http://10.106.178.78:8080/api/charts {"wordpress":[{"name":"wordpress","home":"https://github.com/bitnami/charts/tree/master/bitnami/wordpress","sources":["https://github.com/bitnami/bitnami-docker-wordpress","https://wordpress.org/"],"version":"13.0.23","description":"WordPress is the world's most popular blogging and content management platform. Powerful yet simple, everyone from students to global corporations use it to build beautiful, functional websites.","keywords":["application","blog","cms","http","php","web","wordpress"],"maintainers":[{"name":"Bitnami","email":"containers@bitnami.com"}],"icon":"https://bitnami.com/assets/stacks/wordpress/img/wordpress-stack-220x234.png","apiVersion":"v2","appVersion":"5.9.2","annotations":{"category":"CMS"},"dependencies":[{"name":"memcached","version":"6.x.x","repository":"https://charts.bitnami.com/bitnami","condition":"memcached.enabled"},{"name":"mariadb","version":"10.x.x","repository":"https://charts.bitnami.com/bitnami","condition":"mariadb.enabled"},{"name":"common","version":"1.x.x","repository":"https://charts.bitnami.com/bitnami","tags":["bitnami-common"]}],"urls":["charts/wordpress-13.0.23.tgz"],"created":"2022-09-11T10:00:20.391057325Z","digest":"a4b42912909775eec74ec0cab4c021692bbf8234ead837f2cae3824f0762b228"}]} helm repo update helm install wordpress chartmuseum/wordpress yum groupinstall 'Development Tools' yum install glibc-static tar -zxf chkrootkit.tar.gz cd chkrootkit make sense mkdir /var/log/chkrootkit ./chkrootkit > /var/log/chkrootkit/chkrootkit.log https://elk-docker.readthedocs.io/ echo "vm.max_map_count=262144" >> /etc/sysctl.conf sysctl -p docker load -i sebp_elk-7.16.3.tar docker run -d --name elk --restart always -p 5601:5601 -p 9200:9200 -p 5044:5044 -e TZ=Asia/Shanghai sebp/elk:7.16.3 docker exec -it elk bash /opt/logstash/bin/logstash --path.data /tmp/logstash/data -e 'input { stdin { } } output { elasticsearch { hosts => ["localhost"] } }' this is a dummy entry Ctrl+C http://192.168.100.79:9200/_search?pretty&size=1000 http://192.168.100.79:5601 rpm -ivh filebeat-7.16.3-x86_64.rpm mv /etc/filebeat/filebeat.yml /etc/filebeat/filebeat.yml.bak rm -f /etc/filebeat/filebeat.yml vi /etc/filebeat/filebeat.yml output: logstash: enabled: true hosts: - 192.168.100.79:5044 timeout: 15 ssl: certificate_authorities: - /etc/pki/tls/certs/logstash-beats.crt filebeat: inputs: - paths: - /var/log/messages document_type: syslog vi /etc/pki/tls/certs/logstash-beats.crt -----BEGIN CERTIFICATE----- MIIC6zCCAdOgAwIBAgIJANPZwuf+5wTLMA0GCSqGSIb3DQEBCwUAMAwxCjAIBgNV BAMMASowHhcNMTUxMjI4MTA0NTMyWhcNMjUxMjI1MTA0NTMyWjAMMQowCAYDVQQD DAEqMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAp+jHFvhyYKiPXc7k 0c33f2QV+1hHNyW/uwcJbp5jG82cuQ41v70Z1+b2veBW4sUlDY3yAIEOPSUD8ASt 9m72CAo4xlwYKDvm/Sa3KJtDk0NrQiz6PPyBUFsY+Bj3xn6Nz1RW5YaP+Q1Hjnks PEyQu4vLgfTSGYBHLD4gvs8wDWY7aaKf8DfuP7Ov74Qlj2GOxnmiDEF4tirlko0r qQcvBgujCqA7rNoG+QDmkn3VrxtX8mKF72bxQ7USCyoxD4cWV2mU2HD2Maed3KHj KAvDAzSyBMjI+qi9IlPN5MR7rVqUV0VlSKXBVPct6NG7x4WRwnoKjTXnr3CRADD0 4uvbQQIDAQABo1AwTjAdBgNVHQ4EFgQUVFurgDwdcgnCYxszc0dWMWhB3DswHwYD VR0jBBgwFoAUVFurgDwdcgnCYxszc0dWMWhB3DswDAYDVR0TBAUwAwEB/zANBgkq hkiG9w0BAQsFAAOCAQEAaLSytepMb5LXzOPr9OiuZjTk21a2C84k96f4uqGqKV/s okTTKD0NdeY/IUIINMq4/ERiqn6YDgPgHIYvQheWqnJ8ir69ODcYCpsMXIPau1ow T8c108BEHqBMEjkOQ5LrEjyvLa/29qJ5JsSSiULHvS917nVgY6xhcnRZ0AhuJkiI ARKXwpO5tqJi6BtgzX/3VDSOgVZbvX1uX51Fe9gWwPDgipnYaE/t9TGzJEhKwSah kNr+7RM+Glsv9rx1KcWcx4xxY3basG3/KwvsGAFPvk5tXbZ780VuNFTTZw7q3p8O Gk1zQUBOie0naS0afype5qFMPp586SF/2xAeb68gLg== -----END CERTIFICATE----- systemctl start filebeat l解压docker-repo.tar.gz [root@localhost ~]# tar -zxvf docker-repo.tar.gz -C /opt/ 配置Docker源 [root@localhost ~]# cd /etc/yum.repos.d/ [root@localhost yum.repos.d]# mv * /home/ [root@localhost yum.repos.d]# cat local.repo [centos] name=centos baseurl=http://172.16.100.216/centos gpgcheck=0 enabled=1 [Docker] name=Docker baseurl=file:///opt/docker-repo gpgcheck=0 enabled=1 清理原有的源 [root@localhost yum.repos.d]# yum clean all Loaded plugins: fastestmirror Cleaning repos: Docker 生成缓存 [root@localhost yum.repos.d]# yum makecache Loaded plugins: fastestmirror Determining fastest mirrors Docker | 3.0 kB 00:00:00 centos | 3.6 kB 00:00:00 (1/7): Docker/filelists_db | 138 kB 00:00:00 (2/7): Docker/primary_db | 161 kB 00:00:00 (3/7): Docker/other_db | 80 kB 00:00:00 (4/7): centos/group_gz | 153 kB 00:00:00 (5/7): centos/filelists_db | 3.3 MB 00:00:00 (6/7): centos/primary_db | 3.3 MB 00:00:00 (7/7): centos/other_db | 1.3 MB 00:00:00 Metadata Cache Created 安装Docker 安装Docker [root@localhost ~]# yum install -y docker-ce 启动Docker [root@localhost ~]# systemctl enable docker --now Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service. 导入镜像 [root@localhost ~]# docker load -i sepb_elk_latest.tar 1 启动容器 修改配置文件,不然启动报错 [root@localhost ~]# vim /etc/sysctl.conf 添加 vm.max_map_count = 262144 生效 [root@localhost ~]# sysctl -p vm.max_map_count = 262144 启动容器 [root@localhost ~]# docker run -it -d -p 5601:5601 -p 9200:9200 -p 5044:5044 --name elk -e ES_MIN_MEM=512m -e ES_MAX_MEM=1024m sebp/elk:latest 1 2 浏览器访问 http://IP:5601(华为云注意放通安全组) 安装filebeat,并配置连接elastic 安装 [root@localhost ~]# yum install -y filebeat-7.13.2-x86_64.rpm 1 配置连接 (默认就是连接elastic的,所以output可以不用改) 修改配置文件 [root@localhost ~]# vi /etc/filebeat/filebeat.yml filebeat.inputs: type: log enabled: true paths: /var/log/yum.log output.elasticsearch: hosts: ["localhost:9200"] 启动filebeat 设置开机自启并现在启动 [root@localhost ~]# systemctl enable filebeat --now Created symlink from /etc/systemd/system/multi-user.target.wants/filebeat.service to /usr/lib/systemd/system/filebeat.service. 查看状态 [root@localhost ~]# systemctl status filebeat ● filebeat.service - Filebeat sends log files to Logstash or directly to Elasticsearch. Loaded: loaded (/usr/lib/systemd/system/filebeat.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2022-11-28 04:20:52 EST; 1min 1s ago Docs: https://www.elastic.co/beats/filebeat Main PID: 12835 (filebeat) Tasks: 9 Memory: 124.6M CGroup: /system.slice/filebeat.service └─12835 /usr/share/filebeat/bin/filebeat --environment systemd -c /etc/filebeat/filebeat.yml --path.home /usr/share/filebeat --path.config /etc... 下一步 就会发现有数据了 我们下载一个httpd看看 root@localhost ~]# yum install -y httpd 编写cce_cluster_manager.py文件如下:import time from huaweicloudsdkcce.v3 import * from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkcce.v3.region.cce_region import CceRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkcce.v3 import * import time def get_aksk_v3_cce_token(): ak = "" sk = "" # EZA2ZDBZANMYYEHUHYBD # GMK5KA5qYRmQiuaIpTyFay6QbZ1pohYGPBmAGklY token = BasicCredentials(ak, sk) client = CceClient.new_builder() \ .with_credentials(token) \ .with_region(CceRegion.value_of("cn-north-4")) \ .build() return client class Cluster_Manager: def __init__(self,client): self.client = client def delete_same_cluster(self,name): client = self.client req = ListClustersRequest() resp = client.list_clusters(req) for cluster in resp.items: if cluster.metadata.name == name: clusterId = cluster.metadata.uid delete_req = DeleteClusterRequest() delete_req.cluster_id = clusterId delete_req.delete_efs = "true" delete_req.delete_evs = "true" delete_req.delete_net = "true" delete_req.delete_obs = "true" delete_req.delete_sfs = "true" delete_resp = client.delete_cluster(delete_req) return "" def create_cluster(self): client = self.client req = CreateClusterRequest() metadataBody = ClusterMetadata( name="chinaskillscce2022" ) hostNetwork = HostNetwork( vpc="", subnet="", ) Cidrs = [ ContainerCIDR( cidr="10.0.0.0/16" ) ] containetNetwork = ContainerNetwork( mode="vpc-router", cidrs=Cidrs, ) SpecBody = ClusterSpec( category="CCE", type="VirtualMachine", flavor="cce.s1.small", version="v1.21", host_network=hostNetwork, container_network=containetNetwork, kube_proxy_mode="iptables", ) req.body = Cluster( kind="Cluster", api_version="v3", metadata=metadataBody, spec=SpecBody, ) result = client.create_cluster(req) def list_cluster(self): client = self.client req = ListClustersRequest() req.detail = "true" req.status = "Available" req.type = "VirtualMachine" req.version = "v1.21" result = client.list_clusters(req) print(result) def get_clusterId_by_name(self,name): client = self.client req = ListClustersRequest() resp = client.list_clusters(req) for cluster in resp.items: if cluster.metadata.name == name: clusterId = cluster.metadata.uid return clusterId def show_cluster(self,clusterId): client = self.client req = ShowClusterRequest() req.detail = "true" req.cluster_id = clusterId result = client.show_cluster(req) print(result) if __name__ == "__main__": cluster_m = Cluster_Manager(get_aksk_v3_cce_token()) #delete_same = cluster_m.delete_same_cluster("chinaskillscce2022") #time.sleep(240) create_cluster = cluster_m.create_cluster() #time.sleep(480) #list_cluster = cluster_m.list_cluster() clusterId = cluster_m.get_clusterId_by_name("chinaskillscce2022") show_cluster = cluster_m.show_cluster(clusterId)
-
SQLserver 迁移上云方案 SQLserver导入导出功能:帮助中心 首页> 数据库>云数据库 RDS > 最佳实践 > RDS for SQL Server>导入导出 DRS备份迁移:文档首页> 数据复制服务 DRS> 备份迁移> 创建OBS自建桶备份迁移任务MySQL迁移上云方案文档首页>mysqldump文档首页> 数据复制服务 DRS> 最佳实践> 实时迁移> 本地MySQL迁移到RDS for MySQLOracle迁移上云方案文档首页> 云数据迁移 CDM> 用户指南> 使用教程> Oracle数据迁移到DWS存入OBS再转储至DWSOracle GoldenGate 数据复制迁移整体流程、三大存储不同和应用场景、容器化改造,高可用,大题方案,核心业务上云痛点、OBS生命周期管理、Oracle数据库迁移上云、AS创建流程:论坛云小白核心业务上云痛点:云小白首页双平面图:云小白-云业务知识整理访问海外网站:yd -核心业务上云真难啊云原生与容器、CI/CD等关系图:云小白-云业务知识整理数据库高性能和高可用:云小白-云业务知识整理裸金属优势:云小白-云业务知识整理数据库迁移方法、在线迁移和离线迁移区别和应用场景:yd-几大主流数据库迁移数据迁移方案以及区别、:yd-如何使用数据迁移工具A卷大题目选课、高考、职业规划上云:关于学校和园区的两个解决方案B卷如果客户有高性能场景,如何推荐上云:裸金属+专属主机+ECS高配性能版+异构计算推荐 AI FGPA GPU 等服务器ipsec vpn 与ssl vpn区别:yd容器高可用方案:云小白01zhxx-app.vmdk和zhxx-db.vmdk流程:yd弹性伸缩:ydOBS生命周期管理:ydlamp数据库如何选存储: yd -应用服务器采用通用SSD,数据库mysql服务器采用:超高I/O型 如果有视频或者图片建议OBS存储。共享型负载均衡+CDN:yd8034视频、流媒体容器化改造:yd D卷 公有云计算架构特点以及图:yd C卷 银行分支上云方案大题:云小白-企业容器化改造方案-下面链接 或者六石鲜生论坛
-
各位大神谁有alot在线实训平台的账户嘛各位大神谁有alot在线实训平台的账户嘛各位大神谁有alot在线实训平台的账户嘛各位大神谁有alot在线实训平台的账户嘛
-
一、计算题智慧校园5大业务,智慧家校 智慧办公 智慧学习 智慧教务 智慧环境1.计算1、核数:2*16=32核 内存:8*16g=128g 2、核数:2*16*0.25=8核(0.25平均负载)2*16*0.85=27.2(峰值负载0.85,可取32) 内存:8*16*0.68=87.04G(可取96g) 存储空间:系统盘未知, 数据库盘:8*500g*0.5(raid10利用率)=2000G 要求:1、cpu平均利用率小于50%,2内存利用率小于70%,3无特别说明按照1:1选型,4保证峰值压力。 怎么计算选型?公有云计算架构的特点(1) 超大规模。 “云”具有相当的规模,一般拥有数百上千台服务器,能给用户前所未有的计算能力。(2)虚拟化。云计算支持用户在任意位置、使用各种终端获取应用服务。(3) 高可靠性。“云”使用了数据多副本容错、计算节点同构可互换等措施来保障服务的高可靠性,使用云计算比使用本地计算机可靠。(4) 通用性。云计算不针对特定的应用,同一个“云”可以同时支撑不同的应用运行。(5) 高可扩展性。“云”的规模可以动态伸缩,满足应用和用户规模增长的需要。(6)按需服务。“云”是一个庞大的资源池,你按需购买;云可以象自来水,电,煤气那样计费。(7)极其廉价。由于“云”的特殊容错措施可以采用极其廉价的节点来构成云,“云”的自动化集中式管理使大量企业无需负担日益高昂的数据中心管理成本,“云”的通用性使资源的利用率较之传统系统大幅提升,因此用户可以充分享受“云”的低成本优势,经常只要花费几百美元、几天时间就能完成以前需要数万美元、数月时间才能完成的任务。(图)画计算架构 以及这样设计的优势(与老师确认)优势:1.分区域、跨区域部署,多Region结构,可靠性得到提升2.底层基于Openstack模块化设计,功能丰富优势:(1)控制性完全开源的平台,提供API接口,方便与第三方技术集成(2)兼容性OpenStack兼容其他公有云,方便用户进行数据迁移(3)可扩展性模块化设计,可以通过横向扩展,增加节点、添加资源(4)灵活性根据自己的需要建立相应基础设施、增加集群规模(5)行业标准众多IT领军企业已经加入到OpenStack项目2.私有镜像创建zhxx-app.vmdk和zhxx-db.vmdk是否都能导入华为云镜像的方式部署?对于Vmware镜像文件.vmdk部署为华为云的弹性云服务器ECS,其流程主要步骤有哪些?华为云支持导入vhd、vmdk、qcow2、raw、vhdx、qcow、vdi、qed、zvhd或zvhd2格式镜像文件。使用公有云镜像服务,步骤如下: 准备符合平台要求的外部镜像文件。 上传外部镜像文件到OBS个人桶中。 通过管理控制台选择上传的镜像文件,并将镜像文件注册为私有镜像。 私有镜像注册成功后,使用该镜像创建新的云服务器。二、网络1.学校 华为云 教育局 互联网 网络连线及功能配置说明设计网络 配置ACL和sg(参考C卷)2.2个域名绑定一个IP地址,华为云如何实现,说明步骤(参考C卷)ELB+CDN根据PV值 网页大小 浏览次数 计算带款(学校到华为云、华为云到互联网)假设每次访问的平均页面大小是200K字节,网站的预期目标是每天50W PV的访问量。我们的计算开始:50W PV如果在一天内平均分布,折合到每秒大概是50W/(3600*24)=6次访问,按照我们之前的假设平均页面大小是200K字节计算,这6次访问总 共就是1200K字节(需要注意的是这个地方是字节),字节的单位是Byte,而带宽的单位是bit,1Byte=8bit,因此1200K Byte大概就是9600K bit,也就是9Mbps(1M=1024K)。在实际的网站运行过程中,我们的网站必须要在峰值流量时保持正常的访问,这里就会用到我们之前的假设,峰 值流量是平均流量的5倍,按照这个计算,实际需要的带宽大约在9Mbps*5=45Mbps左右。具体的计算公式是:网站独享带宽=一天总的PV值÷ 一天总时间(换算到S)*平均页面大小(单位KB)* 8
-
部署3台ceph 节点,如下:[root@ceph-1 ceph]# cat ceph.conf[global]fsid = 835f6d27-8e03-4f7f-8d21-b0a26993b529mon_initial_members = ceph-1mon_host = 172.24.193.62auth_cluster_required = cephxauth_service_required = cephxauth_client_required = cephxmon_allow_pool_delete=trueosd_pool_default_size = 2[root@ceph-1 ~]# ceph -s cluster: id: 835f6d27-8e03-4f7f-8d21-b0a26993b529 health: HEALTH_OK services: mon: 1 daemons, quorum ceph-1 mgr: ceph-1(active) osd: 3 osds: 3 up, 3 in data: pools: 1 pools, 128 pgs objects: 510 objects, 1.9 GiB usage: 6.8 GiB used, 233 GiB / 240 GiB avail pgs: 128 active+clean[root@ceph-1 ~]# ceph osd status+----+--------+-------+-------+--------+---------+--------+---------+-----------+| id | host | used | avail | wr ops | wr data | rd ops | rd data | state |+----+--------+-------+-------+--------+---------+--------+---------+-----------+| 0 | ceph-1 | 2170M | 77.8G | 0 | 0 | 0 | 0 | exists,up || 1 | ceph-2 | 2376M | 77.6G | 0 | 0 | 0 | 0 | exists,up || 2 | ceph-3 | 2456M | 77.5G | 0 | 0 | 0 | 0 | exists,up |+----+--------+-------+-------+--------+---------+--------+---------+-----------+[root@ceph-1 ceph]# ceph auth lsinstalled auth entries:osd.0 key: AQDH9qNjHRvdDBAAIS8klDI+PhUUSAwlxmEhKA== caps: [mgr] allow profile osd caps: [mon] allow profile osd caps: [osd] allow *osd.1 key: AQDf9qNjNSttFRAA28htGbtUWAYBxK9kacVHXQ== caps: [mgr] allow profile osd caps: [mon] allow profile osd caps: [osd] allow *osd.2 key: AQDu9qNj43mtGRAAJ4tAU5Ie9carFkhRcwnMnQ== caps: [mgr] allow profile osd caps: [mon] allow profile osd caps: [osd] allow *client.admin key: AQC+86NjAev/HRAAD/wXEPaDVlEOWMn0H2x8ng== caps: [mds] allow * caps: [mgr] allow * caps: [mon] allow * caps: [osd] allow *client.bootstrap-mds key: AQC+86NjHAIAHhAAm0L2LXEzwRx7ijTBMlsmSQ== caps: [mon] allow profile bootstrap-mdsclient.bootstrap-mgr key: AQC+86Nj4xEAHhAADcU3pbq04mk4wK8DxNH6hA== caps: [mon] allow profile bootstrap-mgrclient.bootstrap-osd key: AQC+86NjryAAHhAAzCw13oaWl8EvdrVRCqc+wQ== caps: [mon] allow profile bootstrap-osdclient.bootstrap-rbd key: AQC+86NjEDAAHhAAWev9IkV4zd6gSoUjEEK2ZA== caps: [mon] allow profile bootstrap-rbdclient.bootstrap-rgw key: AQC+86NjXz4AHhAADlfczh0/8voJZuDWkHaJ9w== caps: [mon] allow profile bootstrap-rgwclient.libvirt key: AQDULP9jtWHCMxAAfIBCbNynpHADCYMwQr8xpg== caps: [mon] allow r caps: [osd] allow class-read object_prefix rbd_children, allow rwx pool=libvirt-poolmgr.ceph-1 key: AQAF9KNj6Io3OBAAX6koyzKcwSn+IL5IemY3xg== caps: [mds] allow * caps: [mon] allow profile mgr caps: [osd] allow *在ceph client 上创建vm ,使用ceph rbd 访问 ceph pool libvirt-pool里的qcow2 镜像: 43 <emulator>/usr/local/bin/qemu-system-x86_64</emulator> 44 <disk type='network' device='disk'> 45 <driver name='qemu' type='raw' cache='writeback'/> 46 <auth username='libvirt'> 47 <secret type='ceph' uuid='8187dd57-7e0d-4a9d-8e5a-fe5234d40e51'/> 48 </auth> 49 <source protocol='rbd' name='libvirt-pool/root-vsys_c1.qcow2'> 50 <host name='172.24.193.62' port='6789'/> 51 <host name='172.24.193.63' port='6789'/> 52 <host name='172.24.193.64' port='6789'/> 53 </source> 54 <target dev='vda' bus='virtio'/> 55 <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/> 56 </disk>在ceph-client 上可以利用 client.libvirt 用户访问 ceph 上的libvirt-pool ,如下:如上图卡了,看样子是找不到启动盘了。。。libvirtd 把 root-vsys_c1 xml 中的 启动 虚拟机的命令如下:[root@ceph-client-65 ceph]# rbd --user libvirt ls libvirt-poolroot-vsys_c1.qcow2而我不通过virsh start xxx 方式启动vm,采取直接qemu 启动,则可以成功进入vm 内部,并正常引导kernel这种方式和virsh 方式的不同点,就是 qemu 没有同ceph 进行cephx 验证吧。本人怀疑是 ceph client 接入ceph 认证导致的,可是我都已经参考了此ceph 官网链接:https://docs.ceph.com/en/quincy/rbd/libvirt/ 反复检查了。在创建vm 的客户端节点上都可以访问ceph 集群内。希望有从事ceph 分布式存储这方面实战经验的高手多多指教下这个现象出现的原因及解决方法。谢谢!
-
活动完成了,确定一下,对吗
-
这个控件怎么用呀? 怎么更新全局参数和全局变量的值 在下次执行脚本时可以取到不同的值
-
rap调用远程接口总是返回失败,但是postman中能调用成功;请问这个url说明是什么意思呀
-
RPA能创建excel文件吗?能将excel拆分为多个excel文件吗
-
-
受疫情影响,各组织的云转型进程不断加速,然而业务持续上云却给数据安全带来重重挑战。为此,华为云携手爱数,共同为组织数据安全筑起 “免疫”屏障。一、华为云携手爱数,助力组织数据保护云转型过程中,不少企业开始使用混合云或多云,数据也将同时存在于本地数据中心与公有云中。由于网络带宽与公有云出口流量成本高昂等原因,部署在本地的传统数据保护方案,难以实现对公有云数据快速且经济的保护。对此,华为云携手爱数,重磅推出数据保护服务——爱数 AnyBackup 云备份(华为云云商店在售),为混合云架构下的业务与数据,提供高效且经济的保护,助力各组织建立数据安全屏障,全面护航数据安全。爱数数据保护服务基于任意云到任意云的技术架构,为组织多云、混合云环境中的工作负载提供经济、易用、安全的数据保护服务。无需硬件资源准备,无需繁琐的安装部署,无需复杂的后期服务运维,7分钟即可开通服务,开启数据保护之旅。爱数数据保护服务助力各组织即使在疫情期间,也能实现轻松、灵活的数据保护。二、爱数数据保护服务应用场景数字经济时代,数据已成为一种重要生产要素,对组织生存与发展具有重要意义,然而数据安全却始终面临诸多挑战。1、勒索病毒攻击导致数据被锁定近年来,勒索病毒肆虐,不仅威胁着各组织的数据与财产安全,还可能让各组织随时面临业务停摆的风险。回看曾被勒索病毒攻击的组织,大多遭受了巨额经济损失,甚至数据丢失等风险。2、人为操作导致数据丢失一方面,组织内部员工删库走人事件时有发生;另一方面,即使并非主观意愿,人为误操作导致的数据删除或损坏也难以避免。重要数据的丢失,不仅会影响正常业务的运行,也会影响组织的社会公信力甚至行业地位。3、硬件故障导致数据无法使用随着计算机的长期使用,硬件故障问题难以难免,由此导致的数据无法使用问题,也是一种极具威胁的潜在数据安全隐患。数据是组织最宝贵的无形资产,考虑到威胁数据安全的种种隐患,各组织有必要未雨绸缪,部署数据保护方案,对本地或云上的业务与数据进行保护。三、爱数数据保护服务助您“有备无患”爱数数据保护服务提供的混合云数据保护方案,可以把数据安全高效地备份至华为云 OBS 对象存储中:【本地数据备份上云】对于本地环境中的数据,可以把数据直接备份至公有云,方便、快捷地享受数据保护服务带来的安全性保障;【云中数据快速备份】对于公有云中的数据,可以选择同区域的对象存储作为备份介质,提升整体备份效率,实现更高效的数据保护。爱数数据保护服务,致力于为组织业务与数据建立无懈可击的安全屏障。作为华为云云商店的大数据基础设施服务商,爱数在深刻洞察客户需求的基础上推出爱数数据保护服务,助力客户的数字化转型之旅。未来,爱数将联合华为云以更加创新的产品与技术平台为客户提供整合、治理、洞察与保护的全域数据能力,与各行各业共创数据驱动型组织。文中提到的商品链接:爱数 AnyBackup 云备份(30天免费试用,点击体验!)撰文丨爱数、格子编辑丨格子
-
华为FusionCube融合基础设施一体机(Huawei FusionCube Converged Infrastructure)是华为公司IT产品线云计算领域的旗舰产品。FusionCube遵循开放架构标准,于12U机框中融合刀片服务器、分布式存储及网络交换机为一体,无需外置存储、交换机等设备,并预集成了分布式存储引擎、虚拟化平台及云管理软件,资源可按需调配、线性扩展。 ![image.png](https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20226/16/1655382559768126643.png) # FusionCube链接 https://e.huawei.com/cn/solutions/business-needs/data-center/fusioncube
推荐直播
-
华为AI技术发展与挑战:集成需求分析的实战指南
2024/11/26 周二 18:20-20:20
Alex 华为云学堂技术讲师
本期直播将综合讨论华为AI技术的发展现状,技术挑战,并深入探讨华为AI应用开发过程中的需求分析过程,从理论到实践帮助开发者快速掌握华为AI应用集成需求的框架和方法。
去报名 -
华为云DataArts+DWS助力企业数据治理一站式解决方案及应用实践
2024/11/27 周三 16:30-18:00
Walter.chi 华为云数据治理DTSE技术布道师
想知道数据治理项目中,数据主题域如何合理划分?数据标准及主数据标准如何制定?数仓分层模型如何合理规划?华为云DataArts+DWS助力企业数据治理项目一站式解决方案和应用实践告诉您答案!本期将从数据趋势、数据治理方案、数据治理规划及落地,案例分享四个方面来助力企业数据治理项目合理咨询规划及顺利实施。
去报名
热门标签