centos6.6 虚拟机集群搭建
1、centosos6.6下载
windows 64位:
windows 32位:
http://pan.baidu.com/s/1o8GrpB8
计划安装四台centos6.6虚拟机 centos1、centos2、centos3、centos4,使用VMware® Workstation 12 Pro安装
2、NAT联网
设置固定IP,注意gatway是192.168.121.2,最后一位是2
四台centos机器ip分别是
192.168.121.129 centos1
192.168.121.130 centos2
192.168.121.131 centos3
192.168.121.132 centos4
3、更改centos机器名与hosts文件
vim /etc/sysconfig/network 更改HOSTNAME=centos1 ,同步更新另几台机器centos2、centos3、centos4
更改hosts文件
4、关闭防火墙
后期搭建zookeeper、redis等集群时,可能出现通信问题,因此把防火墙关闭。
命令:service iptables stop;
5、免密登录
集群机器之间通信,需要设置免密登录。使用命令:ssh 机器名(如ssh centos1),如果无需输入密码,直接登录,即已设置免密登录。
1、先免密登录本机。
([root@centos bin]# ssh localhost,命令也会要求输入密码,配置完后就不用输入)
命令:
$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
上面命令即是在本机生成公钥/私钥对,将公钥追加到authorized_keys文件
keygen: 生成公钥/私钥对
-t dsa: 加密方式dsa,也可选择rsa
-P ‘’: 密码为空
-f ~/.ssh/id_dsa: 产生私钥文件,指定私钥后,会同步生成公钥文件id_dsa.pub
cat:将公钥文件追加到authorized_keys文件内。
2、把公钥复制到其它机器的authorized_keys中
把centos1的~/.ssh/id_dsa.pub内容追加到centos2和centos3的~/.ssh/authorized_keys中
把centos2的~/.ssh/id_dsa.pub内容追加到centos1和centos3的~/.ssh/authorized_keys中
把centos3的~/.ssh/id_dsa.pub内容追加到centos1和centos2的~/.ssh/authorized_keys中
经常通过ssh 或者 scp 连接一堆远程主机,同样是 Linux 主机,其中一些创建 ssh 连接速度特别慢,连接建立之后执行操作速度却很正常,看来应该不是网络原因。解决的方法是通过ssh 的-v参数来查看调试信息的:
用 ssh -v 来查看详细的连接建立过程,马上用一台建立连接很慢的主机试了一下,在一大堆输出信息中发现在这里停留最久:
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
No credentials cache found
debug1: Unspecified GSS failure. Minor code may provide more information
No credentials cache found
debug1: Unspecified GSS failure. Minor code may provide more information
debug1: Next authentication method: publickey
原来是因为尝试了个没有意义而且会失败的 gssapi-with-mic 认证方式浪费了时间,打开(远程服务器) /etc/ssh/ssh_config 把里面的 GSSAPIAuthentication yes 改成 no 关掉它,即可让 ssh 直接尝试美妙的 publickey 认证方式。
6、jdk环境搭建
后期搭建的分布式集群,大部分是JAVA环境下运行的。如zookeeper,hadoop,因此虚拟机内都要配置jdk环境。
具体jdk环境搭建,请参考http://www.centoscn.com/image-text/install/2014/0827/3585.html
最新文章
- 伙伴们休息啦canvas绘图夜空小屋
- centos虚拟机网络桥接配置
- Hibernate 二级缓存的配置及使用_EhCache
- 我的第一个hadoop程序
- Practical Java (一)关于reference
- pooling方法修改方案
- 导航代码position:relative
- TCP移动端跟服务器数据交互
- javascript语法详解
- javaSE第十四天
- 使用XCopy发布网页
- jdbc知识问答 分类: 面试 2015-07-10 22:05 5人阅读 评论(0) 收藏
- HUST 1017 Exact cover dance links
- Component migration documentation
- PHPSession-完全PHP5之session篇
- MacOS U盘安装
- snort简介以及在Ubuntu下的安装
- Python网络编程学习_Day9
- arcgis for javascript 自定义infowindow
- git checkout+文件丢失
热门文章
- Oracle删除表、字段之前判断表、字段是否存在
- PHP漏洞全解(五)-SQL注入攻击
- Error format not a string literal and no format arguments解决方案
- POJ 3352 Road Construction (边双连通分量)
- asp 下拉框二级联动
- 在Android手机上安装linux系统
- MySQL 性能调优的10个方法
- .NET System.Timers.Timer的原理和使用(开发定时执行程序)
- [HDU POJ] 逆序数
- codeforces 652C Foe Pairs 水题