shell脚本在容器云中搭建hadoop集群(四)
来源:互联网 发布:写给大家看的c语言书 编辑:程序博客网 时间:2024/06/07 02:27
总结一下今天的学习过程
1,上午继续观看学习Python的数据库编程视屏,测试Django项目使用MariaDB数据库,由列表实现数据库表的映射,总结了区别
sqlite: 不需要继承models.Modelclass student01(): id = models.IntegerField(primary_key=True) name = models.CharField(max_length=50) adress = models.CharField(max_length=50) class Meta: db_table='student01'MariaDB:class User(models.Model): id = models.AutoField(max_length=11,db_column='UID',primary_key=True) userName = models.CharField(max_length=255,db_column='username',blank = False) passWord = models.CharField(max_length=255,db_column='password',blank = False) cid = models.IntegerField(max_length=11,db_column='CID',blank = False) class Meta: db_table = 'user'testDB.User.cid: (fields.W122) 'max_length' is ignored when used with IntegerField设置为整形integer,长度不生效
2,中午以及下午还有晚上陆陆续续的师弟师妹来到实验室,感觉队伍又壮大了
3,今天师兄返校,倍感激动,请教了我之前做的使用shell脚本在docker中搭建hadoop的问题:关于sshd服务开启、hadoop容器之间相互免密登录的问题,实现了从节点的sshd以及其的ssh免密登录,感觉看到了曙光,期待明天能有更多的进展。
# !/bin/bash# start sshd/usr/sbin/sshdhadoopsum=hadoopPwd=echo $hadoopsumecho $hadoopPwdfunction setupHadoopSalve(){allhadoopip=''for ((i=0;i<$hadoopsum;i++));do allhadoopip+="\n192.168.2.1$i hadoop$i";doneallhadoopip+="\n"echo $allhadoopipecho "/etc/hosts......."cat /etc/hostscp /etc/hosts /root/hosts.newecho "/root/hosts.new........"cat /root/hosts.newfor ss in `cat /root/hosts.new | grep hadoop | awk '{print $1}'`;do sed -i '/'$ss'.*/d' /root/hosts.new;doneecho -e "$(cat /root/hosts.new)" > /etc/hostscat /etc/hostsecho -e $allhadoopip >> /etc/hostscd ~rm -rf /root/.sshmkdir /root/.sshexpect -c "set timeout -1; spawn ssh-keygen -t rsa; expect { *(y/n)* {send -- y\r;exp_continue;} *Enter* {send -- \r;exp_continue;} }";expect -c "set timeout -1;spawn ssh-copy-id localhost;expect {*(yes/no)* {send -- yes\r;exp_continue;}*assword:* {send -- $hadoopPwd\r;exp_continue;}eof {exit 0;}}";for hostname in `hostname`;do echo $hostnameexpect -c "set timeout -1;spawn ssh-copy-id $hostname;expect {*(yes/no)* {send -- yes\r;exp_continue;}*assword:* {send -- $hadoopPwd\r;exp_continue;}eof {exit 0;}}";done }setupHadoopSalvefor ss in `ps -e | grep sshd | awk '{print $1}'`;dokill $ss;done/usr/sbin/sshd -D
激动的一天,明天加油!
阅读全文
0 0
- shell脚本在容器云中搭建hadoop集群(四)
- shell脚本在容器云中搭建hadoop集群(一)
- shell脚本在容器云中搭建hadoop集群(二)
- shell脚本在容器云中搭建hadoop集群(五)
- shell脚本在容器云中搭建hadoop集群(六)
- shell脚本在容器云中搭建hadoop集群(七)
- shell脚本搭建容器云(-)
- 整理docker及Hadoop脚本(四)-在docker集群集群中一键式部署hadoop
- 容器云下hadoop集群的搭建
- shell脚本搭建容器云(二)
- 在Centos系统中搭建Hadoop集群
- 搭建Hadoop并在集群中运行
- Hadoop集群化搭建(四)Hadoop-2.6.0安装
- Hadoop----集群搭建指南(中卷)
- shell脚本搭建容器云完结篇(三)
- hadoop集群启动和关闭shell脚本
- shell脚本完成hadoop的集群安装
- 自动化脚本腾讯云配置集群(四)自动化安装从节点的JDK+Hadoop
- 终端配置本地代理
- PHP基础
- 1037. Magic Coupon (25) 利用排序求解最大乘积和
- 一次批量下载发现的问题
- 介绍几种javascript的数据类型
- shell脚本在容器云中搭建hadoop集群(四)
- 百度笔试题
- Manacher 算法
- cassandra nodetool repair
- zookeeper在kafka中的作用
- Python_1
- Spring基于注解的零配置方式的面向切面编程
- HDOJ HDU 1086 You can Solve a Geometry Problem too
- rem布局加载闪烁问题