saltstack(主机改名)
已存在salt中的机器,为了规范,需要将这批主机改名
操作流程:在master把这批机器剔除;然修改这批机器的主机名、在/etc/salt目录下、用mv把minion_id和pki的目录重命名、重启salt-minion服务(在mster段能再次监控到这台主机后、可把上面重命名的文件删除)
环境:http://www.cnblogs.com/zzzhfo/p/6126223.html
把salt-client-01改名为salt-minion-01
- 在salt-server上把salt-client-01剔除
[root@salt-server /]# salt-key -L
Accepted Keys:
salt-client-
salt-client-
Denied Keys:
Unaccepted Keys:
Rejected Keys: [root@salt-server /]# salt-key -d 'salt-client-01' -y
Deleting the following keys:
Accepted Keys:
salt-client-
Key for minion salt-client- deleted.
[root@salt-server /]# salt-key -L
Accepted Keys:
salt-client-
Denied Keys:
Unaccepted Keys:
salt-client-01
Rejected Keys:
修改主机名
[root@salt-client- /]# cat /etc/sysconfig/network #重启生效
NETWORKING=yes
HOSTNAME=salt-minion-
[root@salt-client- /]# hostname salt-minion-
[root@salt-client- /]# bash
删除minion_id和pki(建议使用mv命令)
[root@salt-minion- /]# cd /etc/salt/
[root@salt-minion- salt]#mv minion_id minion_id.bak
[root@salt-minion- salt]# mv pki pki.bak
[root@salt-minion- salt]# /etc/init.d/salt-minion restart
Stopping salt-minion daemon: [ OK ]
Starting salt-minion daemon: [ OK ]
[root@salt-minion- salt]# ls
minion minion.d minion_id minion_id.bak pki pki.bak
查看minion的日志信息
error :salt主缓存节点的公钥,这盐奴才将等待10秒前试图认证
[root@salt-minion- salt]# tail /var/log/salt/minion
-- ::, [salt.crypt ][ERROR ][] The Salt Master has cached the public key for this node, this salt minion will wait for seconds before attempting to re-authenticate
-- ::, [salt.crypt ][ERROR ][] The Salt Master has cached the public key for this node, this salt minion will wait for seconds before attempting to re-authenticate
-- ::, [salt.crypt ][ERROR ][] The Salt Master has cached the public key for this node, this salt minion will wait for seconds before attempting to re-authenticate
-- ::, [salt.crypt ][ERROR ][] The Salt Master has cached the public key for this node, this salt minion will wait for seconds before attempting to re-authenticate
-- ::, [salt.crypt ][ERROR ][] The Salt Master has cached the public key for this node, this salt minion will wait for seconds before attempting to re-authenticate
-- ::, [salt.crypt ][ERROR ][] The Salt Master has cached the public key for this node, this salt minion will wait for seconds before attempting to re-authenticate
-- ::, [salt.crypt ][ERROR ][] The Salt Master has cached the public key for this node, this salt minion will wait for seconds before attempting to re-authenticate
-- ::, [salt.crypt ][ERROR ][] The Salt Master has cached the public key for this node, this salt minion will wait for seconds before attempting to re-authenticate
-- ::, [salt.crypt ][ERROR ][] The Salt Master has cached the public key for this node, this salt minion will wait for seconds before attempting to re-authenticate
-- ::, [salt.crypt ][ERROR ][] The Salt Master has cached the public key for this node, this salt minion will wait for seconds before attempting to re-authenticate
在master端重新认证(可能存在延迟、多刷新几次)
[root@salt-server master]# salt-key -L
Accepted Keys:
salt-client-
Denied Keys:
Unaccepted Keys:
salt-client-
salt-minion-
Rejected Keys:
[root@salt-server master]# salt-key -a 'salt-minion-01' -y
The following keys are going to be accepted:
Unaccepted Keys:
salt-minion-
Key for minion salt-minion- accepted.
[root@salt-server master]# salt-key -L
Accepted Keys:
salt-client-
salt-minion-
Denied Keys:
Unaccepted Keys:
salt-client-
Rejected Keys:
[root@salt-server master]# salt '*' test.ping
salt-minion-:
True
salt-client-:
True
上面用salt-key -L 查看到salt-client-01在等待认证,是因为缓存的原因
[root@salt-server master]# pwd
/etc/salt/pki/master
[root@salt-server master]# ll minions #通过认证的key
total
-rw-r--r--. root root Sep : salt-client-
-rw-r--r--. root root Sep : salt-minion-
[root@salt-server master]# ll minions_pre 等待认证的key
total
-rw-r--r--. root root Sep : salt-client-
[root@salt-server master]# cd minions_pre
[root@salt-server minions_pre]# ls
salt-client- #把它删除 再次查看就不会存在了
[root@salt-server minions_pre]# rm -rf salt-client-
[root@salt-server minions_pre]# ls
[root@salt-server minions_pre]# salt-key -L
Accepted Keys:
salt-client-
salt-minion-
Denied Keys:
Unaccepted Keys:
Rejected Keys:
[root@salt-server minions_pre]# salt-key -L
Accepted Keys:
salt-client-
salt-minion-
Denied Keys:
Unaccepted Keys:
Rejected Keys:
[root@salt-server minions_pre]# salt '*' test.ping
salt-minion-:
True
salt-client-:
True
[root@salt-server minions_pre]# salt '*' cmd.run 'df -h'
salt-minion-:
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 18G 917M 16G % /
tmpfs 495M 12K 495M % /dev/shm
/dev/sda1 485M 31M 429M % /boot
salt-client-:
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 18G 916M 16G % /
tmpfs 495M 12K 495M % /dev/shm
/dev/sda1 485M 31M 429M % /boot
saltstack(主机改名)的更多相关文章
- saltstack主机管理项目:主机管理项目架构设计(二)
1.salt架构图 https://docs.saltstack.com/en/getstarted/system/plugins.html plug-ins(左边):场景可插拔 subsystem- ...
- saltstack主机管理项目【day23】:主机管理项目需求分析-设计
本节内容 一. 主机管理项目需求分析 二 .主机管理项目架构设计 三.主机管理项目初始构建 四. 主机管理项目编主机分发器 一. 主机管理项目需求分析 场景:我现在又一台裸机要实现一下人物 配置管理: ...
- saltstack主机管理项目:编写插件基类-获取主机列表-提取yaml配置文件(四)
一.编写插件基类 1.目录结构 1.我是如何获知我有多少种系统? 当客户端第一连接过来的时候,我就已经把这些文件存下来了 ,存在到哪里了?存到数据库了 每次对主机发送命令的动作时,我从库里把数据取出来 ...
- saltstack主机管理项目:今日总结(六)
一.总目录 二.具体代码 salt #!/usr/bin/env python # -*- coding:utf-8 -*- # Author:luoahong import os,sys if __ ...
- saltstack主机管理项目【day39】:主机管理项目开发
项目目标 salt state.apply -h "ubuntu,centos" -g "ubuntu,centos" -f "ubuntu,cent ...
- saltstack主机管理项目:主机管理项目需求分析(一)
1.场景: 我现在又一台裸机要实现一下任务 2.配置管理: 1.装上nginx,mysql 2.nginx用我指定的配置文件 3.mysql用户 4.设置一个默认的数据库访问权限 5.启动mysql ...
- saltstack主机管理项目:计主机管理项目命令分发器(三)
一.开发目标命令格式如下: 二.目录结构 三.代码注解 01.salt.py 只是一个入口,没干什么事情 #!/usr/bin/env python # -*- coding:utf-8 -*- # ...
- saltstack主机管理项目:动态调用插件解析-模块解析(五)
一.动态调用插件解析 1.目录结构 1.base_module代码解析: def syntax_parser(self,section_name,mod_name,mod_data): print(& ...
- RabbitMQ、RPC、SaltStack "贡"具的使用
消息队列 使用队列的场景 在程序系统中,例如外卖系统,订单系统,库存系统,优先级较高 发红包,发邮件,发短信,app消息推送等任务优先级很低,很适合交给消息队列去处理,以便于程序系统更快的处理其他请求 ...
随机推荐
- python文件读写的学习
文件的读写: file.flush() # 强制刷新 file.readlines() # 将所有的内容生成一个列表,不适合操作大文件 for line in file: # file相当于一个 ...
- BZOJ 1797: [Ahoi2009]Mincut 最小割
1797: [Ahoi2009]Mincut 最小割 Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 2076 Solved: 885[Submit] ...
- Linux下部署docker记录(1)-Volume使用
之前部署了Linux下部署docker记录(0)-基础环境安装,接下来看看Docker Volume的使用. Docker volume使用1)一个数据卷是一个特别指定的目录,该目录利用容器的UFS文 ...
- php 时间加减
<?php date_default_timezone_set('PRC'); //默认时区 echo "今天:",date("Y-m-d",time() ...
- B树、B-树、B+树、B*树
B树 即二叉搜索树: 1.所有非叶子结点至多拥有两个儿子(Left和Right) 2.所有结点存储一个关键字 3.非叶子节点的左指针指向小于其关键字的字数,右指针指向大于其关键字的字数: 如: B树的 ...
- Java通过ODBC链接数据库并遍历结果的一个问题
上一篇文章谈到怎么连接Oracle数据库,其实通过ODBC也差不多,只是driver要换成JdbcOdbcDriver.配置文件如下: driver=sun.jdbc.odbc.JdbcOdbcDri ...
- OrchardNoCMS vNext如何在VS2015下调试
由于VS2015还没有出来正式版,ASP.NET 5也是没有出来正式版.所以在你下载了OrchardNoCMS vNext的代码后,需要配置一些东西,才能启动项目,开始调试. 需要注意以下几点: 1. ...
- JS获取屏幕高度(转)
IE中: document.body.clientWidth ==> BODY对象宽度 document.body.clientHeight ==> BODY对象高度 document.d ...
- 1201MySQL配置文件mysql.ini参数详解
转自http://www.cnblogs.com/feichexia/archive/2012/11/27/mysqlconf.html my.ini(Linux系统下是my.cnf),当mysql服 ...
- android多线程断点续传下载文件
一.目标 1.多线程抢占服务器资源下载. 2.断点续传. 二.实现思路. 假设分为三个线程: 1.各个线程分别向服务器请求文件的不同部分. 这个涉及Http协议,可以在Header中使用Range参数 ...