当前位置: 首页 > news >正文

嘉兴新闻网灰色词seo推广

嘉兴新闻网,灰色词seo推广,网页设计师薪资待遇,seo网站页面f布局1、SSH 工具本身支持多窗口 比如 MobaXterm: 2、编写脚本通过 ssh 在多台机器批量执行shell命令 创建 ssh_hosts 配置文件,定义需要批量执行的节点(必须能够通过 ssh 免密登录,且存在同名用户) vim ssh_hostsbig…

1、SSH 工具本身支持多窗口

比如 MobaXterm:
在这里插入图片描述
在这里插入图片描述

2、编写脚本通过 ssh 在多台机器批量执行shell命令

创建 ssh_hosts 配置文件,定义需要批量执行的节点(必须能够通过 ssh 免密登录,且存在同名用户)

vim ssh_hosts
bigdata0
bigdata1

创建 dosshcmd.sh 脚本:

vim dosshcmd.sh
#! /bin/shdoSshCmd() {hosts=`sed -n '/^[^#]/p' /home/z/scripts/ssh_hosts`for host in $hostsdo echo \[**************** HOST: $host ****************]ssh $host "$@"echo ""donereturn 0
}if [ $# -lt 1 ]
thenecho "$0 cmd"exit
fiecho CMD: "$@"
doSshCmd "$@

赋予执行权限

chmod u+x dosshcmd.sh

3、验证:

1) 验证简单命令:
[root@bigdata0 scripts]# ./dosshcmd.sh free -g
CMD: free -g
[**************** HOST: bigdata0 ****************]total        used        free      shared  buff/cache   available
Mem:             93          13          31           0          49          79
Swap:             3           0           3[**************** HOST: bigdata1 ****************]total        used        free      shared  buff/cache   available
Mem:             93          15           2           0          75          77
Swap:             3           0           3
2) 验证脚本执行:

编写一个通过 jps 找到 pid,然后通过 ps 查看进程信息的简单脚本:

vim find_java_resources.sh
#! /bin/shpids=`jps|grep -i "$1"| cut -d ' ' -f 1`
echo ----find pids: $pids
for pid in $pids
doecho ----PID: $pid----if [ $# -eq 1 ];then ps -q $pid -aux|awk '{print $1, $2, $3, $4, $5, $6, $7, $8, $9, $10}'|column -t elseps -q $pid ${@:2}|awk '{print $1, $2, $3, $4, $5, $6, $7, $8, $9, $10}'|column -tfiecho " "
done

赋予执行权限

chmod u+x find_java_resources.sh

分发:

[root@bigdata0 scripts]# scp find_java_resources.sh bigdata1:`pwd`
find_java_resources.sh                              100%  265     0.3KB/s   00:00    
[root@bigdata0 scripts]#

查看集群每个节点 yarn 任务资源占用

[root@bigdata0 scripts]# ./dosshcmd.sh /home/z/scripts/find_java_resources.sh yarn
CMD: /home/z/scripts/find_java_resources.sh yarn
[**************** HOST: bigdata0 ****************]
----find pids: 31878 31879
----PID: 31878----
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME
root     31878 24.7  1.2 26774340 1204428 ?    Sl   11:10   2:49 ----PID: 31879----
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME
root     31879 25.9  1.2 26743664 1210208 ?    Sl   11:10   2:57​
[**************** HOST: bigdata1 ****************]
----find pids: 30703
----PID: 30703----
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME
root     30703 24.4  2.9 26776844 2854336 ?    Sl   11:14   2:48 

也可以用 watch 监控

watch "./dosshcmd.sh /home/z/scripts/find_java_resources.sh yarn"
http://www.ds6.com.cn/news/115465.html

相关文章:

  • 行业网站建设的书做网络推广的网站有哪些
  • 购物网站如何做网络营销公司全网推广公司
  • ksweb建站教程深圳百度推广客服
  • 做网站郑州汉狮长沙seo推广外包
  • 宽城网站制作百度推广效果怎样一天费用
  • wordpress上传视频人50关键词优化公司哪家效果好
  • 政府网站建设要求自查网络公司推广公司
  • 做网站要icp备案吗百度百度推广
  • led视频网站建设新冠病毒最新消息
  • 适合做手机主页的网站湛江今日头条
  • 第三方做的网站不给源代码外链seo招聘
  • 调取接口做网站怎么创建域名
  • 做网站seo的公司洛阳seo博客
  • wordpress目录 读写权限设置杭州seo关键字优化
  • 最讨厌网站网站自然排名怎么优化
  • 驻马店网站建设公司seo关键词优化方法
  • 肇庆制作网站软件电商网站销售数据分析
  • 如何做x响应式网站石家庄seo外包的公司
  • 兰州有互联网公司嘛百度seo排名培训优化
  • 品牌网站开发动态模块推广网站的四种方法
  • 做网站需要什么执照企业网络营销案例
  • 家庭厨房做外卖网站天津搜索引擎seo
  • 合肥做检查军大网站抖音推广
  • 网站建设实践报告小结软件关键词排名
  • 网站修改图片怎么做博客推广的方法与技巧
  • 苹果手机平板的设计网站重庆森林电影简介
  • 网站内容有什么特点推广搜索怎么选关键词
  • 坊子网站建设互联网平台有哪些
  • 郴州本地网站建设kol营销模式
  • 公众号怎么做网站互联网精准营销