In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. Zookeeper
1 、 / etc/profile
HADOOP_PREFIX=/opt/hadoop
JAVA_HOME=/opt/jdk18
ZOOKEEPER_HOME=/opt/zookeeper
HBASE_HOME=/opt/hbase
PATH=$PATH:$JAVA_HOME/bin:$HADOOP_PREFIX/bin:$HADOOP_PREFIX/sbin:$ZOOKEEPER_HOME/bin:$HBASE_HOME/bin
Export HADOOP_PREFIX PATH JAVA_HOME ZOOKEEPER_HOME HBASE_HOME USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
2. Create a directory:
Mkdir-p / opt/zookeeper/data
Mkdir-p / opt/zookeeper/logs
3. Modify the zoo.cfg configuration file and add it at the end of the file.
Server.1=NameNode34:2888:3888
Server.2=DataNode35:2888:3888
Server.3=DataNode37:2888:3888
Server.4=DataNode38:2888:3888
DataDir=/opt/zookeeper/data
DataLogDir=/opt/zookeeper/logs
4. Create a myid file
Create a myid file under the dataDir directory, and the content of the file varies according to the definition of server, such as server.1, the content of the file is 1, the content of the file is 2, and so on.
Node 1
Echo "1" > myid
Node 2
Echo "2" > myid
Node 3
Echo "3" > myid
Node 4
Echo "4" > myid
5. Copy to other nodes
Scp / etc/profile root@DataNode35:/etc/profile
Scp / etc/profile root@DataNode37:/etc/profile
Scp / etc/profile root@DataNode38:/etc/profile
Scp-r / opt/zookeeper root@DataNode35:/opt
Scp-r / opt/zookeeper root@DataNode37:/opt
Scp-r / opt/zookeeper root@DataNode38:/opt
6. On each node
Source / etc/profile
7. Execute zkServer.sh start on each node
JMX enabled by default
Using config: / usr1/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper... STARTED
1.8 Verification
[hadoop1@node4 bin] $. / zkServer.sh status
JMX enabled by default
Using config: / usr1/zookeeper/bin/../conf/zoo.cfg
Mode: leader
[hadoop1@node1 bin] $. / zkServer.sh status
JMX enabled by default
Using config: / usr1/zookeeper/bin/../conf/zoo.cfg
Mode: follower
[hadoop1@node2 bin] $. / zkServer.sh status
JMX enabled by default
Using config: / usr1/zookeeper/bin/../conf/zoo.cfg
Mode: follower
[hadoop1@node3 bin] $. / zkServer.sh status
JMX enabled by default
Using config: / usr1/zookeeper/bin/../conf/zoo.cfg
Mode: follower
-- The End--
II. Hbase
1. Download hbase
2 、 / etc/profile
HADOOP_PREFIX=/opt/hadoop
JAVA_HOME=/opt/jdk18
ZOOKEEPER_HOME=/opt/zookeeper
HBASE_HOME=/opt/hbase
PATH=$PATH:$JAVA_HOME/bin:$HADOOP_PREFIX/bin:$HADOOP_PREFIX/sbin:$ZOOKEEPER_HOME/bin:$HBASE_HOME/bin
Export HADOOP_PREFIX PATH JAVA_HOME ZOOKEEPER_HOME HBASE_HOME USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
3. Modify the configuration file / opt/hbase/conf/hbase-env.sh
Export JAVA_HOME=/opt/jdk18/
Export HBASE_CLASSPATH=/opt/hbase/conf
Export HBASE_MANAGES_ZK=true
4. Set up a tmp folder under the hbase installation directory
Mkdir tmp
5. Modify hbase-site.xml
Hbase.rootdir
Hdfs://NameNode34:9000/hbase
Hbase.cluster.distributed
True
Hbase.tmp.dir
/ opt/hbase/tmp
Hbase.zookeeper.quorum
NameNode34,DataNode35,DataNode37,DataNode38
Hbase.zookeeper.property.dataDir
/ opt/hbase/tmp/zookeeper
6. Edit / opt/hbase/conf/regionservers and add all the slavenode to this file
NameNode34
DataNode35
DataNode37
DataNode38
7. Copy Hbase to other node machines and configure environment variables for other node machines
Scp / etc/profile root@DataNode35:/etc/profile
Scp / etc/profile root@DataNode37:/etc/profile
Scp / etc/profile root@DataNode38:/etc/profile
Scp-r / opt/hbase root@DataNode35:/opt
Scp-r / opt/hbase root@DataNode37:/opt
Scp-r / opt/hbase root@DataNode38:/opt
8. On each node
Source / etc/profile
9. Start hbase on the primary node (OK only on the primary node)
Start-hbase.sh
10. Verify hbase
Jps
11. Test hbase shell
Hbase shell
Create 'test','data'
Disable 'test'
Dorp 'test'
Reference:
Zookeeper:
Http://blog.chinaunix.net/uid-77311-id-4580114.html
Hbase:
Http://blog.itpub.net/28929558/viewspace-1204409
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.