- 博客(96)
- 收藏
- 关注
原创 【配置docker代理】
vi ~/.docker/config.json{ "proxies":{ "default":{ "httpProxy": "http://xxxxxxx.com:80", "httpsProxy": "http://xxxxx:80" } }, "auths": {
2022-03-10 17:03:52
1169
原创 Prometheus打rpm包
Prometheus打rpm包Prometheus打rpm包Pre-requisite版本要求:To be able to build the react application you need:npm >= v7node >= v16Linux 上安装 Node.jshttps://www.runoob.com/nodejs/nodejs-install-setup.html直接使用已编译好的包Node 官网已经把 linux 下载版本更改为已编译好的版本了,我们可以直接
2021-11-30 17:14:16
954
原创 openstack Rocky版本手动部署
文章目录部署环境准备工作【所有节点】安装ubuntu-18.04.2配置root用户密码配置网卡配置ssh的root登陆权限重启ssh服务修改时区替换阿里安装源客户端安装【所有节点】添加rocky安装源更新安装源列表及更新软件包安装openstack客户端基础服务安装【控制节点】安装mysql配置mysql监听地址重启mysql服务配置root密码安装Rabbitmq添加openstack用户和密码设置openstack权限安装Memcache配置监听地址重启Memcache服务安装etcd配置etcd使能
2021-05-11 11:29:28
1092
原创 python ansible api
from ansible.cli.playbook import PlaybookCLIfrom ansible.plugins.callback import CallbackBaseimport jsonfrom ansible.cli import CLIfrom ansible.executor.playbook_executor import PlaybookExecutorfrom ansible import configfrom ansible import constants.
2021-04-01 16:25:53
360
原创 Linux的网卡参数详解ifcfg-ens33及设置固定ip
TYPE=“Ethernet” #网卡类型:为以太网PROXY_METHOD=“none” #代理方式:关闭状态BROWSER_ONLY=“no”BOOTPROTO=“static” #IP的配置方法[none|static|bootp|dhcp](引导时不使用协议|静态分配IP|BOOTP协议|DHCP协议动态获取ip)IPADDR=10.10.10.10 #本机地址(静态方式需要指定本地Ip,dhcp动态获取不需要这个字段)NETMASK=24
2020-07-31 10:26:30
3695
原创 prometheus修改源码后,怎么打包镜像
修改源码后,在打包镜像时需要重新build:build之前1.需要安装node.jscentos7 安装curl -sL https://rpm.nodesource.com/setup_10.x | bash -yum install -y nodejsnode -v2.需要安装yarncurl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.reposu
2020-07-22 14:50:33
773
原创 quay.io拉取不了镜像
quay.io 替换为quay-mirror.qiniu.com[root@localhost ~]# docker pull quay.io/prometheus/busybox-linux-amd64:latestError response from daemon: Get https://quay.io/v2/: net/http: TLS handshake timeout[root@localhost ~]# docker pull quay.io/prometheus/busybox-l
2020-07-21 15:13:06
3689
原创 minikube:unable to load client CA file /var/lib/minikube/certs/ca.crt
minikube:unable to load client CA file /var/lib/minikube/certs/ca.crt在 Centos 7 上,docker 可能会报告以下错误:Could not read CA certificate “/etc/docker/ca.pem”: open /etc/docker/ca.pem: no such file or directory解决的办法是更新 /etc/sysconfig/docker 以确保遵循了 minikube 的环境更
2020-06-09 11:26:27
742
原创 docker 拉取镜像加速
修改/etc/docker/daemon.json,没有文件就创建加入内容:{“registry-mirrors”: [“http://hub-mirror.c.163.com”,“https://docker.mirrors.ustc.edu.cn/”,“https://registry.docker-cn.com”]}...
2020-03-19 12:21:15
316
1
原创 go sql.Open sql: unknown driver "mysql" (forgotten import?)
golang 连接mysql时会遇到go sql.Open sql: unknown driver “mysql” (forgotten import?)这个错,这是需要引入使用的mysql包再在前面加下划线,下划线作用是只初始化不使用。import( _ "giyhub.com/go-sql-driver/mysql" )...
2020-02-15 22:22:39
2895
原创 Pycharm sqllite3 可视化
使用Pycharm可以像使用navicat 连接mysql一样可视化查看数据库,在本地测试的时候可以使用:右侧的Database:选择项目生产的sqlite3文件:
2020-01-17 10:00:57
762
原创 Django安装mysqlclient报错解决!!!
参考链接:https://pypi.org/project/mysqlclient/仔细看pypi mysqlclient 官网!!!!!!!!!!第一步:InstallPrerequisitesYou may need to install the Python and MySQL development headers and libraries like so:sudo apt...
2020-01-16 17:35:40
856
原创 k8s查看运行中指定pod以及指定pod中容器的日志
1、查看指定pod的日志kubectl logs <pod_name>kubectl logs -f <pod_name> #类似tail -f的方式查看(tail -f 实时查看日志文件 tail -f 日志文件log)2、查看指定pod中指定容器的日志kubectl logs <pod_name> -c <container_name>...
2020-01-15 15:40:11
3548
1
原创 Altermanager 发送告警报 x509: certificate signed by unknown authority 错误解决
这是alter manager配置默认需要证书,官方config解释:The default SMTP TLS requirement.Note that Go does not support unencrypted connections to remote SMTP endpoints.[ smtp_require_tls: | default = true ]所以设置 smtp_...
2020-01-14 09:59:27
3295
1
原创 django/DRFpost 请求时报Forbidden (CSRF cookie not set.)
这是Django对表单post请求做的安全性验证,修改settings.py文件,注释掉django.middleware.csrf.CsrfViewMiddleware’
2020-01-10 10:27:00
699
1
原创 python 删除非空文件夹
shutil库,该库为python内置库,是一个对文件及文件夹高级操作的库,可以与os库互补完成一些操作,如文件夹的整体复制,移动文件夹,对文件重命名等。import shutilshutil.rmtree('./o.walk') # 递归删除非空文件夹...
2019-10-24 16:40:40
271
3
原创 Git 简单总结
1.git 命令git clone;git pushgit status;git commit;…2.git 如何查看某次提交修改的内容x知道commit id的情况下:获取commit idgit log查看commit内容git show commit_id查看最近n次提交的修改git log -p -n指定n为1则可以查看最近一次修改的内容...
2019-10-22 10:35:09
124
原创 有一组“+”和“-”符号,要求将“+”排到左边,“-”排到右边,写出具体的实现方法。
# 有一组“+”和“-”符号,要求将“+”排到左边,“-”排到右边,写出具体的实现方法。def s_sort(arr): list_a = [] list_b = [] for item in arr: if item == '+': list_a.append(item) elif item == '-': ...
2019-10-22 10:27:16
431
1
原创 python 查找列表中的重复元素
# 查找列表中的重复元素def find_duplicate(arr): set_arr = set() dup = set() for x in arr: if x not in set_arr: set_arr.add(x) else: dup.add(x) return du...
2019-10-22 09:37:30
2582
原创 sort 和 sorted 的区别
#sort是在原位重新排列列表,而sorted()是产生一个新的列表>>> a = [3,5,2,8,0]>>> b = a.sort()>>> b>>> a[0, 2, 3, 5, 8] a变了>>> c = [4,2,0,6,1]>>> d = sorted(c)&...
2019-10-21 17:16:05
199
原创 python 合并两个字典
# python3合并字典有三种方式# 1.a = {'a':1,'b':2}b = {'c':3,'d':4}c = {}c.update(a)c.update(b)# 2.c = dict(a,**b)# 3.c = {**a,**b} # 官方推荐这种方式
2019-10-21 15:11:46
261
转载 python docstring
参考:https://blog.youkuaiyun.com/handsomekang/article/details/46830083
2019-10-21 14:37:20
260
原创 python 之禅 ----import this
>>> import thisThe Zen of Python, by Tim PetersBeautiful is better than ugly.Explicit is better than implicit.Simple is better than complex.Complex is better than complicated.Flat is b...
2019-10-21 11:46:36
176
原创 python os.walk()
# os.walk() 方法用于通过在目录树中游走输出在目录中的文件名,向上或者向下。# 第一个参数top 是你所要遍历的目录的地址, 返回的是一个三元组(root,dirs,files)。# 第二个参数topdown --可选,为 True,则优先遍历 top 目录,否则优先遍历 top 的子目录(默认为开启)。如果 topdown 参数为 True,walk 会遍历top文件夹,与top ...
2019-10-18 15:34:23
195
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人