zookeeper事务日志在哪儿

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了zookeeper事务日志在哪儿相关的知识,希望对你有一定的参考价值。

参考技术A 前期准备1.修改Linux主机名,每台都得配置vim /etc/sysconfig/networkNETWORKING=yesHOSTNAME=hadoop-server12.修改IP /etc/sysconfig/network-scripts/ifcfg-eth03.修改主机名和IP的映射关系vim /etc/hosts192.168.146.181 hadoop-server1192.168.146.182 hadoop-server2192.168.146.183 hadoop-server3192.168.146.184 hadoop-server4192.168.146.185 hadoop-server5######注意######如果你们公司是租用的服务器或是使用的云主机(如华为用主机、阿里云主机等)/etc/hosts里面要配置的是内网IP地址和主机名的映射关系4.关闭防火墙 #查看防火墙状态service iptables status#关闭防火墙service iptables stop#查看防火墙开机启动状态chkconfig iptables --list#关闭防火墙开机启动chkconfig iptables off前4步用root用户操作,操作完后重启机器5.ssh免登陆hadoop用户操作#生成ssh免登陆密钥#进入到我的home目录cd ~/.sshssh-keygen -t rsa (四个回车)执行完这个命令后,会生成两个文件id_rsa(私钥)、id_rsa.pub(公钥)将公钥拷贝到要免密登陆的目标机器上ssh-copy-id hadoop-server26.安装JDK,配置环境变量等root用户操作vim /etc/proflieexport JAVA_HOME=/usr/java/jdk1.7.0_65export HADOOP_HOME=/itcast/hadoop-2.4.1export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbinsource /etc/profile集群规划:主机名 IP 安装软件 运行进程hadoop-server1 192.168.146.181:jdk、hadoopnamenode resourcemanageDFSZKFailoverController(zkfc)hadoop-server2 192.168.146.182:jdk、hadoopnamenode resourcemanageDFSZKFailoverController(zkfc)hadoop-server3 192.168.146.183:jdk、hadoop、zookeeperdatanode nodemanagejournalnode QuorumPeerMainhadoop-server4 192.168.146.184:jdk、hadoop、zookeeperdatanode nodemanagejournalnode QuorumPeerMainhadoop-server5 192.168.146.185:jdk、hadoop、zookeeperdatanode nodemanagejournalnode QuorumPeerMain安装步骤:1.安装配置zooekeeper集群(在hadoop-server3上)1.1解压tar -zxvf zookeeper-3.4.5.tar.gz -C /home/hadoop/app/1.2修改配置cd /home/hadoop/app/zookeeper-3.4.5/conf/cp zoo_sample.cfg zoo.cfgvim zoo.cfg修改:dataDir=/home/hadoop/app/zookeeper-3.4.5/data在最后添加:server.1=hadoop-server3:2888:3888server.2=hadoop-server4:2888:3888server.3=hadoop-server5:2888:3888保存退出然后创建一个tmp文件夹mkdir /home/hadoop/app/zookeeper-3.4.5/data再创建一个空文件touch /home/hadoop/app/zookeeper-3.4.5/data/myid最后向该文件写入IDecho 1 > /home/hadoop/app/zookeeper-3.4.5/data/myid1.3将配置好的zookeeper拷贝到其他节点scp -r /home/hadoop/app/zookeeper-3.4.5/ weekend06:/home/hadoop/app/scp -r /home/hadoop/app/zookeeper-3.4.5/ weekend07:/home/hadoop/app/注意:修改hadoop-server4、hadoop-server5对应/home/hadoop/app/zookeeper-3.4.5/data/myid内容hadoop-server4:echo 2 > /home/hadoop/app/zookeeper-3.4.5/data/myidhadoop-server5:echo 3 > /home/hadoop/app/zookeeper-3.4.5/data/myid2.安装配置hadoop集群(在hadoop-server1上操作)2.1解压tar -zxvf hadoop-2.4.1.tar.gz -C /weekend/2.2配置HDFS(hadoop2.0所有的配置文件都在$HADOOP_HOME/etc/hadoop目录下)#将hadoop添加到环境变量中vim /etc/profileexport JAVA_HOME=/hadoop/home/app/jdk1.7.0_55export HADOOP_HOME=/home/hadoop/app/hadoop-2.4.1export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin#hadoop2.0的配置文件全部在$HADOOP_HOME/etc/hadoop下cd /home/hadoop/app/hadoop-2.4.1/etc/hadoop2.2.1修改hadoo-env.shexport JAVA_HOME=/home/hadoop/app/jdk1.7.0_552.2.2修改core-site.xml<configuration><!-- 指定hdfs的nameservice为ns1 --><property><name>fs.defaultFS</name><value>hdfs://ns1/</value></property><!-- 指定hadoop临时目录 --><property><name>hadoop.tmp.dir</name><value>/home/hadoop/app/hadoop-2.4.1/tmp</value></property><!-- 指定zookeeper地址 --><property><name>ha.zookeeper.quorum</name><value>hadoop-server3:2181,hadoop-server3:2181,hadoop-server3:2181</value></property></configuration>2.2.3修改hdfs-site.xml<configuration><!--指定hdfs的nameservice为ns1,需要和core-site.xml中的保持一致 --><property><name>dfs.nameservices</name><value>ns1</value></property><!-- ns1下面有两个NameNode,分别是nn1,nn2 --><property><name>dfs.ha.namenodes.ns1</name><value>nn1,nn2</value></property><!-- nn1的RPC通信地址 --><property><name>dfs.namenode.rpc-address.ns1.nn1</name><value>hadoop-server1:9000</value></property><!-- nn1的http通信地址 --><property><name>dfs.namenode.http-address.ns1.nn1</name><value>hadoop-server1:50070</value></property><!-- nn2的RPC通信地址 --><property><name>dfs.namenode.rpc-address.ns1.nn2</name><value>weekend02:9000</value></property><!-- nn2的http通信地址 --><property><name>dfs.namenode.http-address.ns1.nn2</name><value>hadoop-server2:50070</value></property><!-- 指定NameNode的元数据在JournalNode上的存放位置 --><property><name>dfs.namenode.shared.edits.dir</name><value>qjournal://hadoop-server3:8485;hadoop-server4:8485;hadoop-server5:8485/ns1</value></property><!-- 指定JournalNode在本地磁盘存放数据的位置 --><property><name>dfs.journalnode.edits.dir</name><value>/home/hadoop/app/hadoop-2.4.1/journaldata</value></property><!-- 开启NameNode失败自动切换 --><property><name>dfs.ha.automatic-failover.enabled</name><value>true</value></property><!-- 配置失败自动切换实现方式 --><property><name>dfs.client.failover.proxy.provider.ns1</name><value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value></property><!-- 配置隔离机制方法,多个机制用换行分割,即每个机制暂用一行--><property><name>dfs.ha.fencing.methods</name><value>sshfenceshell(/bin/true)</value></property><!-- 使用sshfence隔离机制时需要ssh免登陆 --><property><name>dfs.ha.fencing.ssh.private-key-files</name><value>/home/hadoop/.ssh/id_rsa</value></property><!-- 配置sshfence隔离机制超时时间 --><property><name>dfs.ha.fencing.ssh.connect-timeout</name><value>30000</value></property></configuration>2.2.4修改mapred-site.xml<configuration><!-- 指定mr框架为yarn方式 --><property><name>mapreduce.framework.name</name><value>yarn</value></property></configuration>2.2.5修改yarn-site.xml<configuration><!-- 开启RM高可用 --><property> <name>yarn.resourcemanager.ha.enabled</name> <value>true</value></property><!-- 指定RM的cluster id --><property> <name>yarn.resourcemanager.cluster-id</name> <value>yrc</value></property><!-- 指定RM的名字 --><property> <name>yarn.resourcemanager.ha.rm-ids</name> <value>rm1,rm2</value></property><!-- 分别指定RM的地址 --><property> <name>yarn.resourcemanager.hostname.rm1</name> <value>hadoop-server1</value></property><property> <name>yarn.resourcemanager.hostname.rm2</name> <value>hadoop-server2</value></property><!-- 指定zk集群地址 --><property> <name>yarn.resourcemanager.zk-address</name> <value>hadoop-server3:2181,hadoop-server4:2181,hadoop-server5:2181</value></property><property> <name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value></property></configuration>2.2.6修改slaves(slaves是指定子节点的位置)hadoop-server3hadoop-server4hadoop-server5 参考技术B 您好,请问您是想知道zookeeper事务日志在哪儿吗?

以上是关于zookeeper事务日志在哪儿的主要内容,如果未能解决你的问题,请参考以下文章

zookeeper 清理snapshot及事务日志.md

如何读取 Zookeeper 事务日志?

Zookeeper源码阅读数据存储-日志

Zookeeper日志文件&事务日志&数据快照

ZooKeeper运维——数据备份与恢复(事务日志+快照日志,万字总结,你想要的都有)

ZooKeeper运维——数据备份与恢复(事务日志+快照日志,万字总结,你想要的都有)