摘要: nginx的负载均衡策略常用的主要有以下四种: 1、轮训(默认),nginx会按请求的时间顺序分配到172.0.0.2和172.0.0.3,如果有出现后端节点故障就会被剔除 upstream a_server{ server 172.0.0.2:8080; server 172.0.0.3:8080 阅读全文
posted @ 2022-06-29 23:13 opscool 阅读(1180) 评论(0) 推荐(0)
摘要: 如下图修改nginx.conf文件的server块 server{ listen 80; server_name 172.0.0.1; location /a/{ proxy_pass http://172.0.0.2:8080 } location /b/{ proxy_pass http://1 阅读全文
posted @ 2022-06-29 22:38 opscool 阅读(42) 评论(0) 推荐(0)
摘要: 当我们修改了nginx.conf文件后重新加载可以使之生效 ./nginx -s reload 注:如果重启nginx进程的话会影响到正在处理的请求事务 阅读全文
posted @ 2022-06-29 14:49 opscool 阅读(317) 评论(0) 推荐(0)
摘要: ./nginx -c /path/nginx.conf 阅读全文
posted @ 2022-06-29 14:43 opscool 阅读(263) 评论(0) 推荐(0)
摘要: 当我们修改了nginx.conf后需要检查一下配置文件 ./nginx -t 如果显示:syntax is ok 、test is successful 两行字样则表示修改后没问题 阅读全文
posted @ 2022-06-29 14:41 opscool 阅读(1465) 评论(0) 推荐(0)
摘要: 当需要访问innodb.locks数据时: select * from innodb.locks; 报错:error 1227(42000):Access denied; you need (at least on of) the PROCESS privilege(s) for this oper 阅读全文
posted @ 2022-06-29 14:13 opscool 阅读(260) 评论(0) 推荐(0)
摘要: 解决方法: cmd中敲命令:python -m ensurepip 阅读全文
posted @ 2022-06-29 13:55 opscool 阅读(37) 评论(0) 推荐(0)
摘要: 阿里云 http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ 豆瓣(douban) http://pypi.douban.com/simple/ 清华大学 https://pypi 阅读全文
posted @ 2022-06-29 13:53 opscool 阅读(102) 评论(0) 推荐(0)
摘要: dict,pop('key') 删除某个键值对,并返回value值 dict = {} 清空字典 del dict 删除字典 阅读全文
posted @ 2022-06-29 13:51 opscool 阅读(150) 评论(0) 推荐(0)
摘要: 例:有a、b两个列表 a = [1, 2, 3] b = [4, 5, 6] 1、调用zip函数 c = zip(a, b) 输出结果 c = [(1, 4), (2, 5), (3, 6)] 2、调用zipped函数 d = zipped(c) 输出结果 d = [(1, 2, 3), (4, 5 阅读全文
posted @ 2022-06-29 13:50 opscool 阅读(78) 评论(0) 推荐(0)
摘要: data = [(“a”, “1”), (”a“, ”2“), (”b“, ”3“)] d2 = {} for k, v in data: d2.setdefault(k, []).append(v) print(d2) 注:setdefault方法会先判断d2这个字典中是否存在k这个键,如果存在就 阅读全文
posted @ 2022-06-29 13:46 opscool 阅读(125) 评论(0) 推荐(0)
摘要: 注:此模块将python代码打包后在windows上可直接双击运行 1、从豆瓣安装pyinstaller pip install -i https://pypi.douban.com/simple/ pyinstaller 2、例子: pyinstaller -F demo.py 会在当前目录下生成 阅读全文
posted @ 2022-06-29 13:42 opscool 阅读(117) 评论(0) 推荐(0)
摘要: 1、cd /usr/lib64/python2.7/site-packages 2、vim tab.py #/usr/bin/env python #_*_encoding:utf-8_*_ try: import readline except ImportError: print("Module 阅读全文
posted @ 2022-06-29 13:32 opscool 阅读(27) 评论(0) 推荐(0)
摘要: 定义: 1、本质是函数 2、功能是装饰其他函数,为其他函数添加附加功能 原则: 1、不能修改被装饰的函数的源代码 2、不能修改被装饰的函数的调用方式 阅读全文
posted @ 2022-06-29 13:31 opscool 阅读(20) 评论(0) 推荐(0)
摘要: 生成器只有在调用的时候才会生成相应的数据 只记录当前的位置 python2.X用的next()方法,python3.X用__next__方法或者next(func) next会调用yield send在调用yield的时候还会传值 阅读全文
posted @ 2022-06-29 13:30 opscool 阅读(22) 评论(0) 推荐(0)
摘要: abs() 求绝对值 all() 判断是否都为真,如all([1,2,-1])返回True,all([1,2,0])返回False any() 判断是否存在真,如any([1,2,0])返回True bin() 数字转为二进制 chr() 返回ascii码 ord() 与chr相反 dir() 返回 阅读全文
posted @ 2022-06-29 13:29 opscool 阅读(30) 评论(0) 推荐(0)
摘要: 1.安装依赖 yum install epel-release 2.安装python3 yum install python36 阅读全文
posted @ 2022-06-29 13:24 opscool 阅读(24) 评论(0) 推荐(0)
摘要: 注:需要先安装好mysql 1、解压下载的nacos压缩包 tar -zxf nacos-server-2.0.3.tar.gz 2、登录mysql,创建nacos数据库 create database nacos; 3、执行nacos目录下的sql脚本 source /data/nacos/con 阅读全文
posted @ 2022-06-29 12:57 opscool 阅读(140) 评论(0) 推荐(0)
摘要: 1、将下载好的mysql压缩包解压到指定目录(下面以/usr/local目录为例) tar -zxf mysql-5.7.13-linux-glibc2.5-x86_64.tar.gz -C /usr/local 2、修改名称 mv mysql-5.7.13 mysql 3、创建数据仓库目录 mkd 阅读全文
posted @ 2022-06-29 12:48 opscool 阅读(331) 评论(0) 推荐(0)
摘要: 1、docker部署 拉取镜像 docker pull kiwenlau/hadoop-master:0.1.0 2、运行容器 下载源代码 git clone https://github.com/kiwenlau/hadoop-cluster-docker 创建网桥 docker network 阅读全文
posted @ 2022-06-29 11:02 opscool 阅读(180) 评论(0) 推荐(0)
摘要: 原因:部分网站不允许非浏览器方式下载文件 解决方法:wget后面加上 --no-check-certificate 阅读全文
posted @ 2022-06-29 10:10 opscool 阅读(540) 评论(0) 推荐(0)
摘要: 第一种方法用yum 安装,快捷方便 yum install epel-release yum install nginx 第二种方法是编译安装: 注:nginx安装需要依赖pcre、openssl,所以提前安装后依赖包然后再安装nginx 1、官网下载nginx版本 2、./configure 3、 阅读全文
posted @ 2022-06-29 10:09 opscool 阅读(34) 评论(0) 推荐(0)
摘要: 1、docker pull 一个nginx(可自选版本或默认最新版本) 2、将容器运行起来,挂载前端目录与配置文件 docker run -d -p 9999:80 --name 名称 -v /data/ui/dist:/usr/share/nginx/html -v /data/ui/nginx. 阅读全文
posted @ 2022-06-29 09:51 opscool 阅读(173) 评论(0) 推荐(0)