Hadoop+zookeeper+Hbase+Hive(ZooKeeper+Hbase) àì夳堔傛蜴生んèń 2023-02-23 08:07 14阅读 0赞 ### 文章目录 ### * * zookeeper * * 修改配置文件 * 创建datadir目录 * 启动zookeeper * Hbase * * 配置Hbase * 启动Hbase ## zookeeper ## ### 修改配置文件 ### vi /zookeeper/conf.cfg ------------------------------------------ # The number of milliseconds of each tick tickTime=2000 maxClientCnxns=0 # The number of ticks that the initial # synchronization phase can take initLimit=50 # The number of ticks that can pass between # sending a request and getting an acknowledgement syncLimit=5 # the directory where the snapshot is stored. dataDir=/opt/hadoop260/zookeeperdata # the port at which the clients will connect clientPort=2181 server.1=hao001:2888:3888 server.2=hao002:2888:3888 server.3=hao003:2888:3888 -------------------------------------------- 复制到三个节点(scp ... ...@hao02:...) ### 创建datadir目录 ### #在对应目录建立zookeeperdata目录 #在新建的zookeeperdata新建文件myid,内容与(server.)数字对应 echo "1" > /opt/hadoop260/zookeeperdata/myid ### 启动zookeeper ### cd /opt/zookeeper ./bin/zkServer.sh start ------------------- tar zookeeper.out ## Hbase ## ### 配置Hbase ### hbase-site.xml vi /opt/hbase/conf/hbase-site.xml ------------------------------------------ <configuration> <property> <name>hbase.rootdir</name> <value>hdfs://hao01:9000/hbase</value> <description>The directory shared by region servers.</description> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> <property> <name>hbase.master.port</name> <value>60000</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>hao01,hao02,hao03</value> </property> <property> <name>hbase.regionserver.handler.count</name> <value>300</value> </property> <property> <name>hbase.hstore.blockingStoreFiles</name> <value>70</value> </property> <property> <name>zookeeper.session.timeout</name> <value>60000</value> </property> <property> <name>hbase.regionserver.restart.on.zk.expire</name> <value>true</value> <description> Zookeeper session expired will force regionserver exit. Enable this will make the regionserver restart. </description> </property> <property> <name>hbase.replication</name> <value>false</value> </property> <property> <name>hfile.block.cache.size</name> <value>0.4</value> </property> <property> <name>hbase.regionserver.global.memstore.upperLimit</name> <value>0.35</value> </property> <property> <name>hbase.hregion.memstore.block.multiplier</name> <value>8</value> </property> <property> <name>hbase.server.thread.wakefrequency</name> <value>100</value> </property> <property> <name>hbase.master.distributed.log.splitting</name> <value>false</value> </property> <property> <name>hbase.regionserver.hlog.splitlog.writer.threads</name> <value>3</value> </property> <property> <name>hbase.hstore.blockingStoreFiles</name> <value>20</value> </property> <property> <name>hbase.hregion.memstore.flush.size</name> <value>134217728</value> </property> <property> <name>hbase.hregion.memstore.mslab.enabled</name> <value>true</value> </property> </configuration> ------------------------------------------ 更多配置:http://hbase.apache.org/book.html#configuration hbase-env.sh vi /opt/hbase/conf/hbase-env.sh ----------------------------------------- export HBASE_HEAPSIZE=4000 export JAVA_HOME=/opt/java8 export HBASE_OPTS="-Xmx8g -Xms8g -Xmn128m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=70 -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:$HBASE_HOME/logs/gc-$(hostname)-hbase.log" # 内存不够可改成4g export HBASE_MANAGES_ZK=false export HBASE_CLASSPATH=/opt/hadoop260/etc/hadoop hadoop配置文件地址 log4j.properties vi /opt/hbase/conf/log4j.properties ------------------------------------------------ # 修改内容 hbase.root.logger=WARN,console log4j.logger.org.apache.hadoop.hbase=WARN regionservers vi /opt/hbase/conf/log4j.properties ------------------------------------------------ # 添加内容 所有datanode节点 hao02 hao03 ### 启动Hbase ### /opt/hbase/bin/start-hbase.sh #启动 -------------------------------------------------- /opt/hbase/bin/start-hbase.sh #停止
还没有评论,来说两句吧...