上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 48 下一页
摘要: shell中一次移动多个文件 mv /root/{flanneld,mk-docker-opts.sh} /usr/local/kubernetes/bin/ 阅读全文
posted @ 2019-02-04 15:55 effortsing 阅读(184) 评论(0) 推荐(0) 编辑
摘要: hostname -i | awk '{print $NF}' 阅读全文
posted @ 2019-02-04 10:23 effortsing 阅读(146) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python #-*- codinig: UTF-8 -*- from __future__ import print_function import os, sys, stat import shutil import tarfile import subprocess output=subprocess.check_output(["hostname"], shel... 阅读全文
posted @ 2019-02-04 10:11 effortsing 阅读(398) 评论(0) 推荐(1) 编辑
摘要: 一、脚本说明: 本实验中master、node、etcd都是单体。 安装顺序为:先安装test1节点主要组件,然后开始安装test2节点,最后回头把test1节点加入集群中,这样做目的是理解以后扩容都需要进行哪些操作 实验架构: test1: 192.168.0.91 etcd、kubectl工具、kube-apiserver、kube-controller-manager、ku... 阅读全文
posted @ 2019-02-02 16:59 effortsing 阅读(453) 评论(0) 推荐(0) 编辑
摘要: 直接看下面实例:In [52]: output=subprocess.check_output(["head -c 16 /dev/urandom | od -An -t x | tr -d ' '"], shell=True) In [53]: print(output) ... 阅读全文
posted @ 2019-02-01 17:20 effortsing 阅读(4050) 评论(0) 推荐(0) 编辑
摘要: 1、用Python Shell设置或获取环境变量的方法: 设置系统环境变量 os.environ['环境变量名称']='环境变量值' #其中key和value均为string类型 os.putenv('环境变量名称', '环境变量值') 获取系统环境变量 os.environ['环境变量名称'] os.getenv('环境变量名称') 实例一、 In [52]: output... 阅读全文
posted @ 2019-02-01 16:22 effortsing 阅读(4051) 评论(0) 推荐(1) 编辑
摘要: subprocess.call 是不能作为赋值的,需要用到 subprocess.check_output 函数,而且如果要引用赋值就必须使用subprocess.call(['echo',line])这种形式。 In [42]: import subprocess In [101]: subprocess.call(['kubectl','get','nodes']) ... 阅读全文
posted @ 2019-02-01 16:21 effortsing 阅读(353) 评论(0) 推荐(0) 编辑
摘要: https://jingyan.baidu.com/article/9faa7231f88570473c28cb88.html 阅读全文
posted @ 2019-02-01 11:27 effortsing 阅读(764) 评论(0) 推荐(0) 编辑
摘要: shell脚本安装python、pip--不需要选择安装项目--不管用总报错,必须带上判断符号,while没有这种用法,写在这里为了以后少走弯路,所以不要用下面的执行了首先把pip-18.0.tar.gz 、Python-3.6.5.tgz 安装包放在 /usr/local 下面,按照顺序先安装pip,再安装python。不要先安装或只安装python,否则很容易出错, #!/bin/bash... 阅读全文
posted @ 2019-01-31 21:42 effortsing 阅读(1951) 评论(0) 推荐(0) 编辑
摘要: 1、subprocess.call 里面的命令分开写,实例如下:subprocess.call 是不能作为赋值的,需要用到 subprocess.check_output 函数,而且如果要引用赋值就必须使用subprocess.call(['echo',line])这种形式。 In [42]: import subprocess In [101]: subprocess.call(['kub... 阅读全文
posted @ 2019-01-31 17:46 effortsing 阅读(5019) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 48 下一页