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消息推送等任务优先级很低,很适合交给消息队列去处理,以便于程序系统更快的处理其他请求 ...
随机推荐
- 洛谷P1462 通往奥格瑞玛的道路[二分答案 spfa 离散化]
题目背景 在艾泽拉斯大陆上有一位名叫歪嘴哦的神奇术士,他是部落的中坚力量 有一天他醒来后发现自己居然到了联盟的主城暴风城 在被众多联盟的士兵攻击后,他决定逃回自己的家乡奥格瑞玛 题目描述 在艾泽拉斯, ...
- POJ2115 C Looooops[扩展欧几里得]
C Looooops Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 24355 Accepted: 6788 Descr ...
- 第7章 权限管理(2)_文件特殊权限(SUID、SGID、SBIT)
2. 文件特殊权限(主要用来临时提升命令执行者或其组身份) 2.1 SetUID (1)SetUID的功能 ①只有可以执行的二进制程序才能设定SUID权限.用来临时提升执行程序(或某条命令)的用户身份 ...
- H5框架之Bootstrap(二)
H5框架之Bootstrap(二) 突然感觉不知道写啥子,脑子里面没水了,可能是因为今晚要出去浪,哈哈~~~提前提醒大家平安夜要回家哦,圣诞节生00000000000这么多蛋....继续 上一篇的已经 ...
- iOS证书问题
链接: 关于IOS免证书真机安装的过程和问题 苹果IOS开发者账号的区别,企业账号,个人账号,公司团队账号,教育账号 苹果IOS开发者账号总结--发布应用APP时team name是否可以随意写? P ...
- libpng使用
自己的实现 unsigned int component(png_const_bytep row, png_uint_32 x, unsigned int c, unsigned int bit_de ...
- js 运算符
一.算术运算符: 1.运算符: “+”:功能:对数字进行代数求和:对字符串进行连接操作:将一个数值转换为字符串(数值+空字符串). “-”:功能:对操作数进行取反操作:对数字进行减法操作:将字符串转换 ...
- 20145208《信息安全系统设计基础》实验五 简单嵌入式WEB 服务器实验
20145208<信息安全系统设计基础>实验五 简单嵌入式WEB 服务器实验 20145208<信息安全系统设计基础>实验五 简单嵌入式WEB 服务器实验
- C#时间戳转时间-时间转时间戳
/// <summary> /// 时间戳转为C#格式时间 /// </summary> /// <param name=”timeStamp”></para ...
- APP
第一天 1.环境初步搭建 SmartSniff fiddler ddms AntiDroid Android Killer 百度方法 http://jingyan.baidu.com/article/ ...