码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • clustershell


    https://clustershell.readthedocs.io/en/latest/tools/index.html

    clush nodeset

    clustershell安装

    yum --enablerepo=extras install epel-release
    yum install clustershell python2-clustershell
    
    • 1
    • 2

    ClusterShell的Python 3子软件包(非必须)

    yum install python34-clustershell
    
    • 1

    clustershell配置

    mkdir /root/.config
    cp -a /etc/clustershell /root/.config/
    
    [root@xxx ~]# pwd
    /root
    [root@xxx ~]# tree .config/
    .config/
    └── clustershell
        ├── clush.conf
        ├── groups.conf
        ├── groups.conf.d
        │   ├── genders.conf.example
        │   ├── README
        │   └── slurm.conf.example
        ├── groups.d
        │   ├── cluster.yaml
        │   ├── local.cfg
        │   └── README
        └── topology.conf.example
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19

    vim /root/.config/clustershell/groups.conf

    confdir: /root/.config/clustershell/groups.conf.d $CFGDIR/groups.conf.d
    
    autodir: /root/.config/clustershell/groups.d $CFGDIR/groups.d
    
    • 1
    • 2
    • 3

    vim /root/.config/clustershell/groups.d/cluster.yaml

    xxx:
      all.all.all: '172.17.0.[2,5-6,9,12,15]'
      a: '
    172.17.0.[2,5,9,12]
    '
      a.b: '
    172.17.0.2
    172.17.0.9
    172.17.0.12
    '
      a.d: '
    172.17.0.2
    172.17.0.5
    172.17.0.12
    '
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15

    说明:

    all.all.all  a  a.b  a.d 都是自定义
    
    • 1

    nodeset

    查看所有的组

    nodeset -LL
    
    • 1

    查看组下面所有的机器ip

    nodeset -e @组名
    
    • 1

    clush

    执行命令

    clush -g 组名 "echo ok"
    clush -g 组名 "echo 'rd*PHy8K9BcE' |passwd --stdin dev"
    
    • 1
    • 2
    clush --hostfile ssh_err.iplist "echo ok"
    
    • 1
    clush -w 10.127.21.16 "echo ok"
    
    • 1

    本地拷贝文件到远程节点上

    clush -w ops-server4 --copy test.file --dest /root/
    
    • 1

    将所有节点的/etc/passwd文件拷贝到本机的/tmp目录下

    clush -a --rcopy /etc/passwd --dest=/tmp
    
    • 1
  • 相关阅读:
    BI业务分析思维:现金流量风控分析(二)信用、流动和投资风险
    用20行python写一个最简单的网站
    echarts绘制地图
    qt textedit图片缩放
    实用电脑软件
    九宫格抽奖动效
    玩转Linux与运维岗(36)
    MySQL并行复制
    体态识别算法在 Android 端部署实例
    File 与 MultipartFile概述
  • 原文地址:https://blog.csdn.net/wuxingge/article/details/133775462
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号