自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(31)
  • 收藏
  • 关注

原创 Postman自动获取signature

传参脚本运行在“Pre-request Script”在Poatman通过设置全局变量实现传参。

2023-08-07 14:05:21 248

原创 在aws云将本地虚拟机镜像上传

参考:VM Import/Export 要求 - VM Import/Export使用 VM Import/Export 将 VM 作为映像导入 - VM Import/Export创建镜像 - EC2 Image Builder1.将vmdk等格式的镜像上传至S3本地文档上传至S3参考:上传对象 - Amazon Simple Storage Service我这里采用的使用 S3 控制台。在官网给的案例为ova格式的镜像导入 VM,如下图:但在实践中,执行aws ..

2022-05-09 14:50:58 2232

原创 Python系统自动化运维-day03 Python 基础语法

1 数字运算编程是将问题数据化的一个过程,数据离不开数字,Python 的数字运算规则与我们学习 的四则运算规则是一样的,即使不使用 Python 来编写复杂的程序,也可以将其当作一个强大 的计算器。打开 Python,试运行以下命令:>>> 2 + 2 4 >>> 50 - 5*6 20 >>> (50 - 5*6) / 4 5.0 >>> 8 / 5 # 总是返回一个浮点数1.6 不同的机器上浮点运算的

2022-04-28 18:07:03 223

原创 Python系统自动化运维-day01 Python 环境搭建

Python 编写的源代码要想得到运行的结果,就需要安装解释 Python 源代码的软件,由其翻译成机器语言并提交操作系统运行,我们通常称之为 Python 解释器或 Python 编程环境。 现在常用的python版本为 Python2.7.x 与 Python3.x ,我要学就学最新的 Python3.x,目前绝大多数 Python2.7.x 的第三方库已经移植到 Python3.x 中了,如果遇到个别仅有 Python2.7.x 支持的,也可以对代码稍做修改在 P...

2022-04-26 18:35:35 2211

原创 CKA备战20-真题 集群故障排查

题目TaskA kubernetes worker node,name wk8s-node-0 is in state NotReady.Investigate why this is the case and perform any appropriate steps to bring the node to a Ready state,ensuring that any changes are made permanent.翻译:一个 kubernetes 工作节点,名称 wk.

2022-04-19 14:48:55 512

原创 CKA备战19-真题 查看最高 CPU 使用率的 Pod

题目TaskFrom the pod label name=cpu-user,find pods running high CPU workloads and write the name of the pod consuming most CPU to the file /opt/KUTR00401/KUTR00401.txt (which already exists).答案#查看cpu使用率$ kubectl config use-context k8s$ kubectl..

2022-04-19 11:16:01 1331

原创 CKA备战18-真题 添加 sidecar container

题目ContextWithout Changing its existing containers,an existing Pod needs to be integrated into Kubernetes's built0in logging architecture(e.g.kubectl logs).Adding a streaming sidecar container is a good and common way to accomplish this requirement .

2022-04-15 18:23:01 461

原创 CKA备战17-真题 监控 pod 的日志

题目Task:Monitor the logs of pod foobar and:Extract log lines corresponding to error unable-to-access-website Write them to /opt/KUTR00101/foobar答案$ kubectl config use-context k8s$ kubectl logs foobar | grep unable-to-access-website > /opt.

2022-04-15 18:09:30 159

原创 CKA备战16-真题 创建 PVC

题目TaskCreate a new PersistentVolumeClaim:Name:web-server Image:nginx Capacity:10MCreate a new pod which mounts thePersistentVolumeClaim:Name:web-server Image:nginx Capacity:/usr/share/nginx/html

2022-04-12 18:47:15 1543 1

原创 CKA备战15-真题 创建 Persistent Volume

题目Set configuration context $ kubectl config use-context hk8sCreae a persistent volume with name app-config of capacity 2Gi and access mode ReadWriteOnce. The type of volume is hostPath and its location is /srv/app-config答案

2022-04-12 11:47:26 143

原创 CKA备战14-真题 创建多个 container 的 Pod

题目Set configuration context $ kubectl config use-context k8sCreate a pod named kucc4 with a single container for each of the following images running inside (there may be between 1 and 4 images specified): nginx + redis + memcached + consul答案.

2022-04-12 11:26:20 2726

原创 CKA备战13-真题:检查有多少 node 节点是健康状态

题目PS:请注意本体不在有 NoSchedule 节点,答案变成 3 个Set configuration context $ kubectl config use-context k8sCheck to see how many nodes are ready (not including nodes tainted NoSchedule) and write the number to /opt/nodenum答案kubectl describe node |grep -.

2022-04-12 11:07:03 801

原创 CKA备战12-真题:将 pod 部署到指定 node 节点上

题目TaskSchedule a pod as follows:Name:nginx-kusc00401 Image:nginx Node selector:disk=spinning答案官网:Kubernetes 文档/概念/工作负载/Pods,Kubernetes 文档/概念/调度,抢占和驱逐/将 Pod 分配给节点https://kubernetes.io/zh/docs/concepts/workloads/pods/pod-topology-sprea.

2022-04-11 17:29:48 1617

原创 CKA备战11-真题:扩展 deployment

题目Scale the deployment loadbalancer to 6 pods答案$ kubectl config use-context k8s$ kubectl scale deployment loadbalancer --replicas=6kubectl scale扩容或缩容 Deployment、ReplicaSet、Replication Controller或 Job 中Pod数量。...

2022-04-11 15:10:49 116

原创 CKA备战10-真题:创建 ingress 资源

题目Create a new nginx ingress resource as follows:Name:pong Namespace:ing-internal Exposing service hi on path /hi using service port 5678The availability of service hi can be checked using the following command,which should return hi答案官网:Ku.

2022-04-11 10:49:36 2610

原创 python爬虫——获取上海市三甲医院名单

参考:https://blog.csdn.net/weixin_45677882/article/details/105463700题目:安居客全国二手房信息,要求字段 # 标题 ,房型,面积,方向,建造年份,小区分析:1.访问安居客网站https://xa.anjuke.com/sale/?pi=360-cpc-xa-cty2&kwid=4139991012&utm_term=%E4%BA%8C%E6%89%8B%E6%88%BF%E5%87%BA%E5%...

2022-04-08 10:30:29 1182

原创 CKA备战09-真题:创建 svc

题目Reconfigure the existing deployment front-end and add a port specification named http exposing port 80/tcp of the existing container nginx.Create a new service named front-end-svc exposing the container port http.Configure the new service to als

2022-04-06 15:45:03 314

原创 Python爬虫解决验证码

参考:https://zhuanlan.zhihu.com/p/1386223931.pytesseractpytesseract是google做的ocr库,可以识别图片中的文字,一般用在爬虫登录时验证码的识别,在安装pytesseract环境过程中会遇到各种坑的事情,如果你需要安装,可以按照如下流程去做,避免踩坑。1.1安装pytesseractpip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mir

2022-04-06 11:09:16 3998

原创 CKA备战08-真题:创建 NetworkPolicy

题目Create a new NetworkPolicy named allow-port-from-namespace that allows Pods in the existing namespace internal to connect to port 9000 of other Pods in the same namespace.Ensure that the new NetworkPolicy:doesnot allow access to Pods not listenin.

2022-04-02 18:40:35 523

原创 CKA备战07-真题:etcd 备份还原

题目First,Create a snapshot of the the existing etcd instance running at https://127.0.0.1:2379 saving the snapshot to the file path /data/backup/etcd-snapshot.dbNext,restore an existing,previous snapshot located at/data/backup/etcd-snapshot-previous.d.

2022-04-02 16:34:22 558 1

原创 CKA备战06-真题:升级 kubernetes 节点

题目Given an existing Kubernetes cluster running version 1.18.8,upgrade all of theKubernetes control plane and node components on the master node only to version 1.19.0You are also expected to upgrade kubelet and kubectl on the master node.答案官网..

2022-04-01 18:12:39 143

原创 CKA备战04-真题:RBAC

做之前记得切换到对应context :kubectl config use-context k8sQ1:RBACCreate a new ClusterRole named deployment-clusterrole at only allows the creation of the following resource types:DeploymentStatefulSetDaemonSetCreate a new Servi...

2022-04-01 11:39:58 286

原创 内核添加一个自定义模块

(以一个简单的hello world程序为例)通过编译安装内核模块在/proc目录下添加文件。1.写一个hello.c源代码文件,代码如下 #include <linux/init.h> #include <linux/module.h> #include <linux/sched.h> MODULE_LICENSE("Dual BSD/GPL"); static void hello_init(voi

2021-11-12 11:15:13 232

原创 利用perf及FlameGraph生成火焰图

https://www.cnblogs.com/asver/p/13895779.htmlhttps://blog.csdn.net/Xiaobai__Lee/article/details/109471969案例,查看本机CPU使用率的火焰图:1. 查看cpu使用率[root@test ~]# perf top2.执行perf record在当前目录下面生成一个perf.data文件perf的运行原理简单概括就是给定一个采样频率,根据采样频率每隔一段时间对CPU进行一次中断并根

2021-10-19 16:19:42 631

原创 两个或多个docker容器之间通过名字相互访问

前言由于容器的 IP 地址会在容器重启后发生变化,因不能写死 IP 地址,使用容器的名字访问容器服务是最优的,所以就有了下文。1.使用 --link 参考docker run --link可以用来链接2个容器,使得源容器(被链接的容器)和接收容器(主动去链接的容器)之间可以互相通信,并且接收容器可以获取源容器的一些数据,如源容器的环境变量。--link的格式:--link <name or id>:alias其中,name和id是源容器的name和id,alias是源容器

2021-10-19 12:03:42 10296

原创 mysql主从复制原理及配置

0、为什么需要主从复制?1、在业务复杂的系统中,有这么一个情景,有一句sql语句需要锁表,导致暂时不能使用读的服务,那么就很影响运行中的业务,使用主从复制,让主库负责写,从库负责读,这样,即使主库出现了锁表的情景,通过读从库也可以保证业务的正常运作。2、做数据的热备3、架构的扩展。业务量越来越大,I/O访问频率过高,单机无法满足,此时做多库的存储,降低磁盘I/O访问的频率,提高单个机器的I/O性能。1、什么是mysql的主从复制?MySQL 主从复制是指数据可以从一个MySQL数据库服务

2021-10-18 09:54:16 656

原创 Linux 内核模块查看命令

ldd命令,显示应用程序(二进制程序)所依赖的库文件[root@ambari01 ~]# ldd /lib64/libhandle.so.1 linux-vdso.so.1 => (0x0000ffff9ea70000) libc.so.6 => /lib64/libc.so.6 (0x0000ffff9e890000) /lib/ld-linux-aarch64.so.1 (0x0000ffff9ea80000)lsmod:显示...

2021-10-15 15:58:23 2175

原创 KVM虚拟化

KVM虚拟化参考:https://blog.csdn.net/weixin_43695104/article/details/88554443虚拟化是云计算的基础。简单的说,虚拟化使得在一台物理的服务器上可以跑多台虚拟机,虚拟机共享物理机的 CPU、内存、IO 硬件资源,但逻辑上虚拟机之间是相互隔离的。物理机我们一般称为宿主机(Host),宿主机上面的虚拟机称为客户机(Guest)。那么 Host 是如何将自己的硬件资源虚拟化,并提供给 Guest 使用的呢?这个主要是通过一个叫做 Hyp

2021-10-15 15:40:00 247

原创 Linux:开机硬盘自动挂载

查看Linux硬盘信息fdisk -l1格式化新硬盘(操作有风险,谨慎操作)sudo mkfs.ext4 /dev/sdb11ext4:格式化格式/dev/sdb1:磁盘创建挂载目录sudo mkdir data1挂载分区sudo mount /dev/sdb1 /data1重启服务器后,需要重新执行挂载分区,所以在后续步骤会配置重启自动挂载查看磁盘分区UUIDsudo blkid1内容大致如下:/dev/sda1: UUID="8048997a-16c9-4

2021-10-15 14:59:01 2707

原创 用python读取Excel数据

参考:https://blog.csdn.net/weixin_43179111/article/details/82745390​​​​​​https://www.jb51.net/article/180348.htmhttps://www.jb51.net/article/211271.htmPython中几种常用包比较最近xlrd更新到了2.0.1版本,只支持.xls文件。所以pandas.read_excel(‘xxx.xlsx’)会报错:xlrd.biffh.XLRDError

2021-09-29 10:13:53 998

原创 Pyhton3网页爬虫查询快递状况

参考:https://cloud.tencent.com/developer/article/1697758​​​​​​前言先说一下走过的坑,在一开始的思路就是去找个快递查询的网站查一下快递,然后抓一下包就能拿到我们需要的内容,然后写个爬虫去追踪快递信息,结果一百度发现基本国内查快递的网站用的都是快递100的API,申请个API还要提供一个网站供对方审核,并且还有次数限制。不申请API直接爬得到的物流信息被各种加密,使用python爬虫获取的到的物流信息都并不可靠,这篇文章主要是用来做python爬

2021-09-27 11:43:14 1023

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除