Home Database Mysql Tutorial Hadoop集群(CDH4)实践之 (2) HBase&Zookeeper搭建

Hadoop集群(CDH4)实践之 (2) HBase&Zookeeper搭建

Jun 07, 2016 pm 04:32 PM
amp hadoop hbase practice cluster

目录结构 Hadoop集群(CDH4)实践之 (0) 前言 Hadoop集群(CDH4)实践之 (1) Hadoop(HDFS)搭建 Hadoop集群(CDH4)实践之 (2) HBaseZookeeper搭建 Hadoop集群(CDH4)实践之 (3) Hive搭建 Hadoop集群(CHD4)实践之 (4) Oozie搭建 Hadoop集群(CHD4)实践之 (5) Sqoop安

目录结构
Hadoop集群(CDH4)实践之 (0) 前言
Hadoop集群(CDH4)实践之 (1) Hadoop(HDFS)搭建
Hadoop集群(CDH4)实践之 (2) HBase&Zookeeper搭建
Hadoop集群(CDH4)实践之 (3) Hive搭建
Hadoop集群(CHD4)实践之 (4) Oozie搭建
Hadoop集群(CHD4)实践之 (5) Sqoop安装

本文内容
Hadoop集群(CDH4)实践之 (2) HBase&Zookeeper搭建

参考资料
http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH4/latest/CDH4-Installation-Guide/CDH4-Installation-Guide.html

环境准备
OS: CentOS 6.4 x86_64
Servers:
hadoop-master: 172.17.20.230 内存10G
- namenode
- hbase-master

hadoop-secondarynamenode: 172.17.20.234 内存10G
- secondarybackupnamenode,jobtracker

hadoop-node-1: 172.17.20.231 内存10G sudo yum install hbase-regionserver
- datanode,tasktracker
- hbase-regionserver,zookeeper-server

hadoop-node-2: 172.17.20.232 内存10G
- datanode,tasktracker
- hbase-regionserver,zookeeper-server

hadoop-node-3: 172.17.20.233 内存10G
- datanode,tasktracker
- hbase-regionserver,zookeeper-server

对以上角色做一些简单的介绍:
namenode - 整个HDFS的命名空间管理服务
secondarynamenode - 可以看做是namenode的冗余服务
jobtracker - 并行计算的job管理服务
datanode - HDFS的节点服务
tasktracker - 并行计算的job执行服务
hbase-master - Hbase的管理服务
hbase-regionServer - 对Client端插入,删除,查询数据等提供服务
zookeeper-server - Zookeeper协作与配置管理服务

本文定义的规范,避免在配置多台服务器上产生理解上的混乱:
所有直接以 $ 开头,没有跟随主机名的命令,都代表需要在所有的服务器上执行,除非后面有单独的//开头或在标题说明。

1. 安装前的准备
Hadoop集群(CDH4)实践之 (1) Hadoop(HDFS)搭建

配置NTP时钟同步
$ sudo yum install ntp
$ sudo /etc/init.d/ntpd start

配置ulimit与nproc参数
$ sudo vim /etc/security/limits.conf

 
hdfs  -       nofile  32768
hbase -       nofile  32768
Copy after login

退出并重新登录SSH使设置生效

2. 在hadoop-secondary上安装hbase-master
$ sudo yum install hbase-master
$ sudo yum install hbase-rest
$ sudo yum install hbase-thrift

3. 在hadoop-node上安装hbase-regionserver
$ sudo yum install hbase-regionserver

4. 在HDFS中创建HBase的目录
以下HDFS操作仅需在任意一台主机上执行一次
$ sudo -u hdfs hadoop fs -mkdir /hbase
$ sudo -u hdfs hadoop fs -chown hbase /hbase

5. 配置hbase-site.xml
$ sudo vim /etc/hbase/conf/hbase-site.xml
$ cat /etc/hbase/conf/hbase-site.xml

 
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://heylinux.com/archives/configuration.xsl"?>
  hbase.rest.port
  60050
  hbase.cluster.distributed
  true
  hbase.rootdir
  hdfs://hadoop-master:8020/hbase
  hbase.zookeeper.quorum
  hadoop-node-1,hadoop-node-2,hadoop-node-3
Copy after login

6. 配置regionservers
$ sudo vim /etc/hbase/conf/regionservers

 
hadoop-node-1
hadoop-node-2
hadoop-node-3
Copy after login

7. 安装Zookeeper
$ sudo yum install zookeeper
$ sudo vim /etc/zookeeper/conf/zoo.cfg
$ cat /etc/zookeeper/conf/zoo.cfg

 
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/var/lib/zookeeper
clientPort=2181
maxClientCnxns=0
server.1=hadoop-node-1:2888:3888
server.2=hadoop-node-2:2888:3888
server.3=hadoop-node-3:2888:3888
Copy after login

8. 在hadoop-node上安装zookeeper-server并创建myid文件
$ sudo yum install zookeeper-server
$ sudo touch /var/lib/zookeeper/myid
$ sudo chown -R zookeeper:zookeeper /var/lib/zookeeper
$ echo 1 > /var/lib/zookeeper/myid //仅在hadoop-node-1上执行
$ echo 2 > /var/lib/zookeeper/myid //仅在hadoop-node-2上执行
$ echo 3 > /var/lib/zookeeper/myid //仅在hadoop-node-3上执行

$ sudo /etc/init.d/zookeeper-server init //仅在任一hadoop-node上执行一次
$ sudo /etc/init.d/zookeeper-server start

9. 启动Hbase服务
仅在hadoop-master上
$ sudo /etc/init.d/hbase-master start
$ sudo /etc/init.d/hbase-thrift start
$ sudo /etc/init.d/hbase-rest start

仅在hadoop-node上
$ sudo /etc/init.d/hbase-regionserver start

10. 查看服务的状态
通过网页查看 http://hadoop-master:60010

11. 至此,HBase&Zookeeper的搭建就已经完成。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Dreamweaver CMS station group practice sharing Dreamweaver CMS station group practice sharing Mar 18, 2024 am 10:18 AM

Dream Weaver CMS Station Group Practice Sharing In recent years, with the rapid development of the Internet, website construction has become more and more important. When building multiple websites, site group technology has become a very effective method. Among the many website construction tools, Dreamweaver CMS has become the first choice of many website enthusiasts due to its flexibility and ease of use. This article will share some practical experience about Dreamweaver CMS station group, as well as some specific code examples, hoping to provide some help to readers who are exploring station group technology. 1. What is Dreamweaver CMS station group? Dream Weaver CMS

How to stop Outlook from automatically adding events to my calendar How to stop Outlook from automatically adding events to my calendar Feb 26, 2024 am 09:49 AM

As an email manager application, Microsoft Outlook allows us to schedule events and appointments. It enables us to stay organized by providing tools to create, manage and track these activities (also called events) in the Outlook application. However, sometimes unwanted events are added to the calendar in Outlook, which creates confusion for users and spams the calendar. In this article, we will explore various scenarios and steps that can help us prevent Outlook from automatically adding events to my calendar. Outlook Events – A brief overview Outlook events serve multiple purposes and have many useful features as follows: Calendar Integration: In Outlook

In-depth discussion of the principles and practices of the Struts framework In-depth discussion of the principles and practices of the Struts framework Feb 18, 2024 pm 06:10 PM

Principle analysis and practical exploration of the Struts framework. As a commonly used MVC framework in JavaWeb development, the Struts framework has good design patterns and scalability and is widely used in enterprise-level application development. This article will analyze the principles of the Struts framework and explore it with actual code examples to help readers better understand and apply the framework. 1. Analysis of the principles of the Struts framework 1. MVC architecture The Struts framework is based on MVC (Model-View-Con

PHP Coding Practices: Refusing Alternatives to Goto Statements PHP Coding Practices: Refusing Alternatives to Goto Statements Mar 28, 2024 pm 09:24 PM

PHP Coding Practices: Refusal to Use Alternatives to Goto Statements In recent years, with the continuous updating and iteration of programming languages, programmers have begun to pay more attention to coding specifications and best practices. In PHP programming, the goto statement has existed as a control flow statement for a long time, but in practical applications it often leads to a decrease in the readability and maintainability of the code. This article will share some alternatives to help developers refuse to use goto statements and improve code quality. 1. Why refuse to use goto statement? First, let's think about why

Node completely evacuates from Proxmox VE and rejoins the cluster Node completely evacuates from Proxmox VE and rejoins the cluster Feb 21, 2024 pm 12:40 PM

Scenario description for nodes to completely evacuate from ProxmoxVE and rejoin the cluster. When a node in the ProxmoxVE cluster is damaged and cannot be repaired quickly, the faulty node needs to be kicked out of the cluster cleanly and the residual information must be cleaned up. Otherwise, new nodes using the IP address used by the faulty node will not be able to join the cluster normally; similarly, after the faulty node that has separated from the cluster is repaired, although it has nothing to do with the cluster, it will not be able to access the web management of this single node. In the background, information about other nodes in the original ProxmoxVE cluster will appear, which is very annoying. Evict nodes from the cluster. If ProxmoxVE is a Ceph hyper-converged cluster, you need to log in to any node in the cluster (except the node you want to delete) on the host system Debian, and run the command

C++ Reflection Mechanism Practice: Implementing Flexible Runtime Type Information C++ Reflection Mechanism Practice: Implementing Flexible Runtime Type Information Nov 27, 2023 pm 01:11 PM

C++ Reflection Mechanism Practice: Implementing Flexible Runtime Type Information Introduction: C++ is a strongly typed language and does not directly provide a reflection mechanism to obtain class type information like other languages. However, with some tricks and technical means, we can also achieve similar reflection functions in C++. This article describes how to leverage template metaprogramming and macro definitions to achieve flexible runtime type information. 1. What is the reflection mechanism? The reflection mechanism refers to obtaining the type information of a class at runtime, such as the class name, member functions, member variables and other attributes.

Best Practices for Traffic Management with Golang Best Practices for Traffic Management with Golang Mar 07, 2024 am 08:27 AM

Golang is a powerful and efficient programming language that is widely used to build web services and applications. In network services, traffic management is a crucial part. It can help us control and optimize data transmission on the network and ensure the stability and performance of services. This article will introduce the best practices for traffic management using Golang and provide specific code examples. 1. Use Golang’s net package for basic traffic management. Golang’s net package provides a way to handle network data.

A practical guide to remote development using PyCharm A practical guide to remote development using PyCharm Feb 25, 2024 pm 07:18 PM

Using PyCharm for remote development is an efficient way that allows developers to easily edit, debug and run code on the remote server in the local environment. This article will introduce how to use PyCharm for remote development practice, and combine it with specific code examples to help readers better understand and apply this technology. What is PyCharmPyCharm is a Python integrated development environment (IDE) developed by JetBrains, which provides a wealth of functions and tools to help

See all articles