linux zookeeper 集群搭建
来源:互联网 发布:44gbgb新域名 编辑:程序博客网 时间:2024/05/17 05:17
网上有很多zookeeper安装的教程,简洁明了的如
http://blog.csdn.net/gobitan/article/details/8659175
我这里安装过程与上述文章没有大的区别只是为了管理方便使用以下代码复制zookeeper的相关文件
(源码见:https://github.com/alphg/zookeeper-hadoop-hbase-setup-tools 源码经过优化与本文中的代码不同)
#!/usr/bin/expect -fset src [lindex $argv 0]set dest [lindex $argv 1]set pwd [lindex $argv 2]spawn scp -r ${src} ${dest}expect {"(yes/no)" {send "yes\r";exp_continue}"password:" {send "${pwd}\r"}}expect eofexit
将上述代码保存为scp.exp 执行时传入3个参数 第一个参数为要复制的文件 第二个参数为文件要复制的目标位置 第三个参数为复制过程中会用到的用户密码(运行此段代码需要正确安装expect,安装方法问度娘)如
./scp.exp /home/hadoop/workspace/zookeeper root@h1:/home/hadoop/workspace 900614
即将本地的 /home/Hadoop/workspace/zookeeper目录以及目录下的所有内容全部使用主机h1的root帐户复制到h1上的目录/home/Hadoop/workspace/下,主机h1的root帐户密码是900614
我们如果再在外层编写一段shell代码,就可以在集群中批量复制文件,而不需要为每次复制都输入密码
#!/bin/bashhosts=(h3 h4 h5)//主机名for ((i=0;i<${#hosts[@]};i++))//循环hosts数组,do ./scp.exp /home/hadoop/workspace/zookeeper root@${host[i]}:/home/hadoop/workspace 900614done
0 0
- linux Zookeeper集群搭建
- linux搭建zookeeper集群
- linux zookeeper 集群搭建
- linux 搭建zookeeper集群
- linux下搭建zookeeper集群
- Linux 上搭建 Zookeeper集群
- Linux下搭建zookeeper集群
- zookeeper-linux集群搭建小结
- linux上搭建zookeeper集群
- linux 搭建zookeeper注册中心(集群)
- zookeeper集群在linux上的搭建
- Linux系统的Zookeeper集群环境搭建
- Linux系统的Zookeeper集群环境搭建
- linux环境下zookeeper集群搭建
- (3) linux下zookeeper伪集群搭建
- linux上zookeeper伪集群的搭建
- Linux下安装zookeeper以及Zookeeper的集群搭建
- Zookeeper 介绍 Zookeeper 搭建 Zookeeper 集群搭建
- hdu acm 1191 Specialized Four-Digit Numbers
- Logistic回归、softmax回归以及tensorflow实现MNIST识别
- 管理oracle
- (Java)LeetCode-62. Unique Paths
- 读书笔记:C++ primer 5th edition--chapter 3.字符串,向量,数组
- linux zookeeper 集群搭建
- 【J2EE核心开发学习笔记 008】JSP的九大内置对象和四个作用域
- 顺时针打印矩阵
- Cocos2dx随机数及编译APK失败问题
- Java封装
- 读书笔记:C++ primer 5th edition--chapter 6.函数
- VS2015+openGL环境配置
- @Query(扩展MongoRepository接口)---------springMVC的另一类的写法
- MotionEvent简析