摘要: 实验前环境: [root@super65 ~]# salt-key -L[root@super65 ~]# salt-key -a super65.cn -y salt管理对象简介: saltstack管理的对象叫做target。 管理的对象很多是我们需要对不同的对象进行分类。saltstack是如 阅读全文
posted @ 2016-09-17 10:23 xuanhui 阅读(193) 评论(0) 推荐(0)
摘要: 192.168.1.65 super65.cn master192.168.1.66 super66.cn minion saltstack使用SSL签证的方式进行安全认证。 minion上线后先与master端联系,把自己的pub key发过去,这时master端通过salt-key -L命令就会 阅读全文
posted @ 2016-09-17 09:47 xuanhui 阅读(391) 评论(0) 推荐(0)
摘要: super65 master 192.168.1.65 super66 minion 192.168.1.66 主配置文件: [root@super65 ~]# ll /etc/salt/master -rw-r 1 root root 29543 Mar 23 06:24 /etc/salt/ma 阅读全文
posted @ 2016-09-17 09:27 xuanhui 阅读(182) 评论(0) 推荐(0)
摘要: 系统环境:CentOS6.5 准备yum源: epel源(包含了saltstack的包)、阿里源(CentOS-Base.repo) Host解析文件: # cat /etc/hosts 192.168.1.65 super65.cn192.168.1.66 super66.cn saltstack 阅读全文
posted @ 2016-09-17 09:08 xuanhui 阅读(223) 评论(0) 推荐(0)
摘要: (集合可以看做是字典去掉value由key组成的) 1:数据元素唯一 2:无序 3:不可变 集合的应用场景: 如果说之后做爬虫的时候,首先你是不是获取到连接,(递归),是不是同一个连接你不能重复去爬取下载 去重 ,我们就可以放到集合中 定义: s=set('xiaofan')print(s) {'i 阅读全文
posted @ 2016-09-16 15:07 xuanhui 阅读(138) 评论(0) 推荐(0)
摘要: 抛出异常: try: print("handel") #raise #抛出异常 except Exception: print('error!')else: print("no error just exec!!")finally: print("aways exec!") print("一般用来关 阅读全文
posted @ 2016-09-16 14:52 xuanhui 阅读(171) 评论(0) 推荐(0)
摘要: 定义: >>> dic={1:'a',2:'b'}>>> dic{1: 'a', 2: 'b'} >>> dic=dict(([3,"x"],[4,"y"]))>>> dic{3: 'x', 4: 'y'} 字典key是唯一的 字典是可变类型 字典是无序的类型 >>> dic={1:"a",2:"b 阅读全文
posted @ 2016-09-16 14:42 xuanhui 阅读(132) 评论(0) 推荐(0)
摘要: dir()查看属性(函数和数据对象) help()查看具体的帮助文档 id() 用来查看数据对象的地址 split 分隔(str > list): >>> s="my:name:is:xiaofan">>> s.split(":")['my', 'name', 'is', 'xiaofan'] jo 阅读全文
posted @ 2016-09-16 14:26 xuanhui 阅读(210) 评论(0) 推荐(0)
摘要: 破解root密码:方法一:1、/etc/my.cnf在[mysqld]段中加入skip-grant-table2、重启mysql3、直接mysql登录3、通过修改权限表方式修改mysql密码(update)4、去除my.cnf中skip-grant-table5、重启mysql6、使用新密码登录 方 阅读全文
posted @ 2016-09-13 23:35 xuanhui 阅读(153) 评论(0) 推荐(0)
摘要: mysql> show grants for root@'localhost';+ +| Grants for root@localhost |+ +| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD 阅读全文
posted @ 2016-09-13 23:31 xuanhui 阅读(172) 评论(0) 推荐(0)