上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 48 下一页
摘要: 1、初始化一个role [root@bogon ~]# ansible-galaxy init /etc/ansible/roles/websrvs 查看已经创建的role [root@bogon ~]# ls /etc/ansible/roles/ webservs 2、配置role 把初始化后 role里面没用的删除,只留下面四个目录 [root@bogon ~]# cd /e... 阅读全文
posted @ 2019-01-17 20:21 effortsing 阅读(341) 评论(0) 推荐(0) 编辑
摘要: playbook文件 [root@localhost ~]# cat deploy_mongo.yaml --- - hosts: webservers become: yes become_method: sudo vars: mongodb_datadir_prefix: /data mongod_port: 25000 tasks: - ... 阅读全文
posted @ 2019-01-17 14:19 effortsing 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 1、配置yum源 [root@www ~]# cat /etc/yum.repos.d/mongodb-org-3.4.repo [mongodb-org-3.4] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/ gpgche... 阅读全文
posted @ 2019-01-17 13:06 effortsing 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 提前把mongodb-linux-x86_64-rhel70-3.2.4.tgz放到和脚本相同目录下,然后把下复制到脚本里面,开始执行 #!/usr/bin/python #-*- codinig: UTF-8 -*- from __future__ import print_function import os import shutil import tarfile import subp... 阅读全文
posted @ 2019-01-17 11:29 effortsing 阅读(394) 评论(0) 推荐(0) 编辑
摘要: 定义playbook的主机组 说明: 1、playbook的主机组和ansible的主机组不一样, 2、playbook的主机组文件必须要和playbook文件在同一个目录下否则会报如下错误: [root@test1 profile]# ansible-playbook -i hosts deploy_flanneld.yaml --list-hosts [WARNING]: Unab... 阅读全文
posted @ 2019-01-17 10:55 effortsing 阅读(378) 评论(0) 推荐(0) 编辑
摘要: 1、首先开启系统,一直按 e 键 进入编辑选项 2、光标下移,在UTF-8行这一段修改两处,首相找到ro改为rw,即只读改为可读写权限;然后在这段的尾部加入 init=/bin/sh 3、此时按住Ctrl+x快捷键进入拯救模式 4、开始修改密码 chroot /sysroot passwd root touch /.autorelabel 5、重启系统 reboot 阅读全文
posted @ 2019-01-15 22:11 effortsing 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 1、查看当前selinux的状态命令为 getenforce 2、两个都要关。注意先看看有么有这两个文件,如果没有就创建一个,否则后期会出现很多问题 cat > /etc/selinux/config << EOF # This file controls the state of SELinux on the system. # SELINUX= can take one of th... 阅读全文
posted @ 2019-01-15 19:27 effortsing 阅读(931) 评论(0) 推荐(0) 编辑
摘要: 使用ssh-agent的好处: 如果有多台远程服务器与多个私钥文件,ssh-gent将会尝试使用不同的私钥文件建立连接,直至成功 假如有 A、B、C 三台服务器,A是控制节点,A可以直接登录B,但是无法直接登录C,只能先登录B,再从B登录C,这样的话就需要在B中也保存私钥。所以使用ssh-agent,开启agent forwarding,就不用在B中保存私钥,只在A中保存私钥,在B、C 中保... 阅读全文
posted @ 2019-01-15 11:01 effortsing 阅读(1010) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/chengzi_comm/article/details/78778284 阅读全文
posted @ 2018-12-19 13:39 effortsing 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 参照文档:http://www.cnblogs.com/xiaodai12138/p/9996995.html 阅读全文
posted @ 2018-12-19 13:38 effortsing 阅读(456) 评论(0) 推荐(0) 编辑
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 48 下一页