09 2020 档案

摘要:Linux系统安全 我们一般不会使用root账户去操作我们系统,root在Linux中有至高无上的权利 我们一般会开通一个普通用户的权限并赋予sudo的权限 普通用户在操作系统时可临时提权 创建普通用户 # 创建用户 useradd -m -s /bin/bash dbuser # 修改密码 pas 阅读全文
posted @ 2020-09-27 22:52 LeoShi2020 阅读(6411) 评论(0) 推荐(0) 编辑
摘要:tar常用命令: 主选项: -x 从档案文件中释放文件。 -c 创建新的档案文件。如果用户想备份一个目录或是一些文件,就要选择这个选项。 -r 把要存档的文件追加到档案文件的末尾。例如用户已经做好备份文件,又发现还有一个目录或 是一些文件忘 记备份了,这时可以使用该选项,将忘记的目录或文件追加到备份 阅读全文
posted @ 2020-09-18 17:47 LeoShi2020 阅读(743) 评论(0) 推荐(0) 编辑
摘要:交换机管理 登录账号密码很长输入很不方便 cat > tl.sh <<'EOF' #!/usr/bin/expect #set passwd "12345678\n" set timeout 20 # 外部传递参数 set host [lindex $argv 0] spawn telnet $ho 阅读全文
posted @ 2020-09-16 10:56 LeoShi2020 阅读(190) 评论(0) 推荐(0) 编辑
摘要:官网 在被管理的节点上用正则对目标文件的一行内容修改删除 在一个文件中匹配的多行统一处理 参考replace 文件中多行处理blockinline path 目标文件路径 state absent删除 regexp 正则匹配 最后一行被替换 line 要在文件中插入替换的行 create 文件不存在 阅读全文
posted @ 2020-09-14 22:31 LeoShi2020 阅读(1452) 评论(0) 推荐(0) 编辑
摘要:官网 Jinjia2文件模板,可以进行文档内变量的替换 src 指定控制端文件路径 dest 被控端文件路径 owner 文件属主 group 文件属组 mode 文件权限 backup 创建一个时间戳的备份文件 # 创建模板文件 [root@ceph1 yum.repos.d]# cat /tmp 阅读全文
posted @ 2020-09-14 22:05 LeoShi2020 阅读(733) 评论(0) 推荐(0) 编辑
摘要:官网 调试模块主要是输出变量 var 直接打印一个指定变量的值 msg 打印一段可以格式化的字符串 ## -e 传变量 ansible webservers -m debug -a "var=role" -e "role=web" [root@ceph1 ~]# ansible webservers 阅读全文
posted @ 2020-09-14 16:46 LeoShi2020 阅读(3022) 评论(0) 推荐(0) 编辑
摘要:官网 该模块只能创建并管理的计划任务,不能被系统crontab -e 管理 name cronjob名字 minute 分钟 (Minute when the job should run ( 0-59, *, */2, etc )) hour 小时 (Hour when the job shoul 阅读全文
posted @ 2020-09-14 16:39 LeoShi2020 阅读(576) 评论(0) 推荐(0) 编辑
摘要:官网 group 定义文件目录的属组 mode 权限 owner 属主 path 路径 recurse 递归目录 src link路径 dest 被链接到的路径 state absent 删除 directory 目录不存在创建 file 不创建文件检查文件是否存在 hard 硬链接 link 软链 阅读全文
posted @ 2020-09-14 16:25 LeoShi2020 阅读(1362) 评论(0) 推荐(0) 编辑
摘要:Grooup name 组名称 system 是否为系统组yes | no(默认值) # 添加用户组 ansible dbservers -m group -a "name=db_admin" ansible dbservers -m shell -a "cat /etc/group | grep 阅读全文
posted @ 2020-09-14 15:26 LeoShi2020 阅读(294) 评论(0) 推荐(0) 编辑
摘要:官网 [root@ceph1 ~]# cat a.repo [epel] name=Extra Packages for Enterprise Linux 7 - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/7/$bas 阅读全文
posted @ 2020-09-14 14:58 LeoShi2020 阅读(271) 评论(0) 推荐(0) 编辑
摘要:将管理节点的脚本上传至被管理节点执行,理论上此模块不许需要被管理服务器上有python [root@ceph1 ~]# cat a.sh touch /tmp/ansible-script [root@ceph1 ~]# ansible webservers -m script -a "a.sh" 阅读全文
posted @ 2020-09-14 14:57 LeoShi2020 阅读(1262) 评论(0) 推荐(0) 编辑
摘要:默认是command模块 shell模块 可以使用shell内置命令 管道 [root@ceph1 ~]# ansible all -a "echo 'hello'" ceph3 | CHANGED | rc=0 >> hello ceph2 | CHANGED | rc=0 >> hello [r 阅读全文
posted @ 2020-09-14 14:56 LeoShi2020 阅读(443) 评论(0) 推荐(0) 编辑
摘要:官网 deamon_reload 重新载入systemd enabled 开机是否启动 name 必选项 state (reloaded、restarted、started、stopped) # 刷新服务 ansible webservers -m systemd -a "deamon_reload 阅读全文
posted @ 2020-09-14 14:40 LeoShi2020 阅读(2532) 评论(0) 推荐(0) 编辑
摘要:官网 name 包名,多个用','隔开 state 对指定软件安装移除操作 present 确认已安装不升级 installed 确认已经安装 latest 确保安装并升级 absent removed 删除 # 安装nginx ansible webservers -m yum -a "name= 阅读全文
posted @ 2020-09-14 14:26 LeoShi2020 阅读(162) 评论(0) 推荐(0) 编辑
摘要:添加yum源 ansible all -m yum_repository -a "name=epel \ description='EPEL TUM repo' \ baseurl='https://mirrors.aliyun.com/epel/7/x86_64/' \ gpgcheck=no \ 阅读全文
posted @ 2020-09-14 14:13 LeoShi2020 阅读(1139) 评论(0) 推荐(0) 编辑
摘要:[root@ceph1 ceph-deploy]# systemctl status ceph-osd@1 ● ceph-osd@1.service - Ceph object storage daemon osd.1 Loaded: loaded (/usr/lib/systemd/system/ 阅读全文
posted @ 2020-09-11 23:50 LeoShi2020 阅读(3458) 评论(0) 推荐(0) 编辑
摘要:# 修改配置文件添加 [mon] mon allow pool delete = true # 推送配置 [root@ceph1 ceph-deploy]# ceph-deploy --overwrite-conf config push ceph1 ceph2 ceph3 # 重启所有节点mon 阅读全文
posted @ 2020-09-11 21:01 LeoShi2020 阅读(1610) 评论(0) 推荐(0) 编辑
摘要:故障信息 [root@ceph1 hdd]# ceph -s cluster: id: eb4d0231-7f7d-4b07-97a8-c84a46c8ac73 health: HEALTH_WARN application not enabled on 2 pool(s) services: mo 阅读全文
posted @ 2020-09-11 15:59 LeoShi2020 阅读(548) 评论(0) 推荐(0) 编辑
摘要:# 问题: rbd map 失败 [root@ceph1 ceph-deploy]# rbd map ssdpool/rbd-ssd.img rbd: sysfs write failed RBD image feature set mismatch. You can disable feature 阅读全文
posted @ 2020-09-11 13:47 LeoShi2020 阅读(975) 评论(0) 推荐(0) 编辑
摘要:# 正常卸载报错 [root@DB1 ~]# umount /mnt/iscsi umount: /mnt/iscsi: target is busy. (In some cases useful info about processes that use the device is found b 阅读全文
posted @ 2020-09-08 14:16 LeoShi2020 阅读(574) 评论(0) 推荐(0) 编辑
摘要:# 需要删除 -filename= [root@DB1 iscis]# ls -li total 0 67 drw 3 root root 17 Sep 6 22:35 -filename= [root@DB1 iscis]# find . -inum 67 | xargs rm -rf [root 阅读全文
posted @ 2020-09-07 10:10 LeoShi2020 阅读(626) 评论(0) 推荐(0) 编辑
摘要:RBD块设备无法删除 [root@node-1 ~]# rbd rm ceph-demo/rbd-snap-new.img 2020-09-05 13:36:32.838 7f51067fc700 -1 librbd::image::PreRemoveRequest: 0x55bab7ded380 阅读全文
posted @ 2020-09-05 13:39 LeoShi2020 阅读(497) 评论(0) 推荐(0) 编辑
摘要:报错 [root@node-3 dev]# lsblk lsblk: dm-3:获取设备路径失败 lsblk: dm-3:获取设备路径失败 查看映射信息并删除 [root@node-3 dev]# dmsetup ls ceph--adb6548e--8602--44c9--9ba7--234795 阅读全文
posted @ 2020-09-02 20:56 LeoShi2020 阅读(1897) 评论(1) 推荐(0) 编辑
摘要:删除sdc [root@node-3 ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 20G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 19G 0 part ├─cento 阅读全文
posted @ 2020-09-02 20:54 LeoShi2020 阅读(1623) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示