Hadoop配置文件与HBase配置文件

本Hadoop与HBase集群有1台NameNode, 7台DataNode

1. /etc/hostname文件

NameNode:

node1

DataNode 1:

node2

DataNode 2:

node3

.......

DataNode 7:

node8

2. /etc/hosts文件

NameNode:

127.0.0.1	localhost
#127.0.1.1	node1
#-------edit by HY(2014-05-04)--------
#127.0.1.1	node1
125.216.241.113 node1
125.216.241.112 node2
125.216.241.96 node3
125.216.241.111 node4
125.216.241.114 node5
125.216.241.115 node6
125.216.241.116 node7
125.216.241.117 node8
#-------end edit--------

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

DataNode 1:

127.0.0.1	localhost
#127.0.0.1	node2
#127.0.1.1	node2
#--------eidt by HY(2014-05-04)--------
125.216.241.113 node1
125.216.241.112 node2
125.216.241.96 node3
125.216.241.111 node4
125.216.241.114 node5
125.216.241.115 node6
125.216.241.116 node7
125.216.241.117 node8
#-------end eidt---------

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

其他的DataNode类似,只是注意要保持hostname与hosts中的域名要一样, 如果不一样, 在集群上跑任务时会出一些莫名奇妙的问题, 具体什么问题忘记了.

3. 在hadoop-env.sh中注释

# export JAVA_HOME=/usr/lib/j2sdk1.5-sun

增加

JAVA_HOME=/usr/lib/jvm/java-6-sun

4. core-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
<property>
 <name>fs.default.name</name>
  <value>hdfs://node1:49000</value>
</property>
<property>
  <name>hadoop.tmp.dir</name>
 <value>/home/hadoop/newdata/hadoop-1.2.1/tmp</value>
</property>
<property>
<name>io.compression.codecs</name>
<value>org.apache.hadoop.io.compress.DefaultCodec,org.apache.hadoop.io.compress.GzipCodec,org.apache.hadoop.io.compress.BZip2Codec,com.hadoop.compression.lzo.LzoCodec,com.hadoop.compression.lzo.LzopCodec</value>
</property>
<property>
<name>io.compression.codec.lzo.class</name>
<value>com.hadoop.compression.lzo.LzoCodec</value>
</property>
   <property>
     <name>dfs.datanode.socket.write.timeout</name>
     <value>3000000</value>
   </property>

   <property>
     <name>dfs.socket.timeout</name>
     <value>3000000</value>
   </property>
</configuration>

5. hdfs-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
<property>
<name>dfs.name.dir</name>
<value>/home/hadoop/newdata/hadoop-1.2.1/name1,/home/hadoop/newdata/hadoop-1.2.1/name2</value>
<description>数据元信息存储位置</description>
</property>
<property>
<name>dfs.data.dir</name>
<value>/home/hadoop/newdata/hadoop-1.2.1/data1,/home/hadoop/newdata/hadoop-1.2.1/data2</value>
<description>数据块存储位置</description>
</property>
<property>
  <name>dfs.replication</name>
  <!-- 这里备份两份 -->
  <value>2</value>
</property>
</configuration>

6. mapred-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
<property>
  <name>mapred.job.tracker</name>
  <value>node1:49001</value>
</property>
<property>
  <name>mapred.local.dir</name>
 <value>/home/hadoop/newdata/hadoop-1.2.1/tmp</value>
</property>
<property>
<name>mapred.compress.map.output</name>
<value>true</value>
<!-- map 和 reduce 输出中间文件默认开启压缩 -->
</property>
<property>
<name>mapred.map.output.compression.codec</name>
<value>com.hadoop.compression.lzo.LzoCodec</value>
<!-- 使用 Lzo 库作为压缩算法 -->
</property>
</configuration>

7. masters

node1

8. slaves

node2
node3
node4
node5
node6
node7
node8

9. 在hbase-env.sh

增加

JAVA_HOME=/usr/lib/jvm/java-6-sun

并启用export HBASE_MANAGES_ZK=true //为true表示使用自带的Zookeeper, 如果需要独立的Zookeeper,则设置为false, 并且安装Zookeeper

10. hbase-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
/**
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-->
<configuration>
    <property>
        <name>hbase.rootdir</name>
        <value>hdfs://node1:49000/hbase</value>
        <description>The directory shared by RegionServers.</description>
    </property>

    <property>
        <name>hbase.cluster.distributed</name>
        <value>true</value>
        <description>The mode the cluster will be in. Possible values are
            false: standalone and pseudo-distributed setups with managed Zookeeper
            true: fully-distributed with unmanaged Zookeeper Quorum (see hbase-env.sh)
        </description>
    </property>

    <property>
        <name>hbase.master</name>
        <value>node1:60000</value>
        <description>
        </description>
    </property>

    <property>
        <name>hbase.tmp.dir</name>
        <value>/home/hadoop/newdata/hbase/tmp</value>
        <description>
            Temporary directory on the local filesystem.
            Change this setting to point to a location more permanent than ‘/tmp‘,
            the usual resolve for java.io.tmpdir,
            as the ‘/tmp‘ directory is cleared on machine restart.
            Default: ${java.io.tmpdir}/hbase-${user.name}
        </description>
    </property>

    <property>
        <name>hbase.zookeeper.quorum</name>
        <value>node2,node3,node4,node5,node6,node7,node8</value>
        <description>
            要单数台,Comma separated list of servers in the ZooKeeper ensemble (This config.
            should have been named hbase.zookeeper.ensemble).
            For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com".
            By default this is set to localhost for local and pseudo-distributed
            modes of operation.
            For a fully-distributed setup,
            this should be set to a full list of ZooKeeper ensemble servers.
            If HBASE_MANAGES_ZK is set in hbase-env.sh this is the list of servers
            which hbase will start/stop ZooKeeper on as part of cluster start/stop.
            Client-side, we will take this list of ensemble members and put it
            together with the hbase.zookeeper.clientPort config.
            and pass it into zookeeper constructor as the connectString parameter.
            Default: localhost
        </description>
    </property>

    <property>
        <name>hbase.zookeeper.property.dataDir</name>
        <value>/home/hadoop/newdata/zookeeper</value>
        <description>
            Property from ZooKeeper‘s config zoo.cfg.
            The directory where the snapshot is stored.
            Default: ${hbase.tmp.dir}/zookeeper
        </description>
    </property>

    <property>
        <name></name>
        <value></value>
    </property>
</configuration>

11. regionservers

node2
node3
node4
node5
node6
node7
node8

每台机器配置都要一样

Hadoop配置文件与HBase配置文件

时间: 2024-12-28 18:28:57

Hadoop配置文件与HBase配置文件的相关文章

Hadoop上配置Hbase数据库

已有环境: 1. Ubuntu:14.04.2 2.jdk: 1.8.0_45 3.hadoop:2.6.0 4.hBase:1.0.0 详细过程: 1.下载最新的Hbase,这里我下载的是hbase-1.0.0版本,然后打开终端,输入: tar zxvf hbase-1.0.0.tar.gz解压,然后将hbase放到合适的路径下(可以是用户目录,也可以是根目录,不太清楚是否必须要与hadoop放在用一个根目录下,本人是放在同一个目录下的) 2.修改2个配置文件(这里是伪分布式,单机版不再叙述)

Hadoop及Zookeeper+HBase完全分布式集群部署

Hadoop及HBase集群部署 一. 集群环境 系统版本 虚拟机:内存 16G CPU 双核心 系统: CentOS-7 64位 系统下载地址: http://124.202.164.6/files/417500000AB646E7/mirrors.163.com/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1708.iso 软件版本 hadoop-2.8.1.tar.gz hbase-1.3.1-bin.tar.gz zookeeper-3.4.10.t

2.27linux和windows互传文件 3.1 用户配置文件和密码配置文件 3.2 用户组管理 3.3 用户管理

2.27linux和windows互传文件 3.1 用户配置文件和密码配置文件 3.2 用户组管理 3.3 用户管理 2.27 linux和windows互传文件 首相只能使用远程工具 xshell  .securecrt 首先安装一个包 yum install  -y lrzsz sz + 文件名   把linux 上的文件 传到  windows上 把 linux 上的 4.txt 传到windows 上 使用rz 回车 就可以吧windows 上的文件传到linux 下 的当前目录下 传输

Hadoop重启,Hbase出现Master exiting的错误:org.apache.hadoop.hbase.master.HMasterCommandLine: Master exiting

hadoop hdfs 重新启动或者重新格式话,可能会出现一些数据丢失,报错hbase的. 我的是试验环境,所以需要重新清理这些数据. 首先要重新创建hbase在hdfs里面的文件夹: 并把赋予拥有者权限 $ sudo -u hdfs hadoop fs -mkdir /hbase $ sudo -u hdfs hadoop fs -chown hbase /hbase 清理hbase在zookeeper中的缓存数据,缓存的目录在hbase-site.xml中有. hbase启动出现错误: 20

linux和windows互传文件/用户配置文件和密码配置文件/用户组管理/用户管理

2.27linux和windows互传文件 3.1 用户配置文件和密码配置文件 3.2 用户组管理 3.3 用户管理 linux和windows互传文件 显示日期date [[email protected]_1 ~]# date 2017年 11月 21日 星期二 08:38:25 CST 显示系统语言 [[email protected]_1 ~]# echo $LANG zh_CN.UTF-8 [[email protected]_1 ~]# stat 1.txt.bak 文件:"1.tx

2.27Linux和windows互传;3.1用户配置文件和密码配置文件;3.2/3.3用户组用户

2.27 Linux和windows互传文件 1. yum安装 lrzsz: [[email protected] ~]# yum install -y lrzsz 2. Linux上的文件,传输给windows下:sz 跟文件 [[email protected] ~]# sz 1.txt 3. windows上的文件,传输给Linux下: [[email protected] ~]# rz 3.1 用户配置文件和密码配置文件 1. 查看系统用户文件:/etc/passwd [[email p

用户配置文件和密码配置文件、用户组管理、用户管理、usermod命令

        用户配置文件和密码配置文件 用户配置文件:/etc/passwd /etc/passwd 用户密码文件,当我们增加一个用户时,文件就会增加相应的一行内容. 第一个字段:为用户名 第二个字段:该用户的登录口令(密码,密码其实是在/etc/passwd,安全起见这里用x表示)  第三个字段:uid(用户标识号) 第四个字段:gid(组标识号) 第五个字段:注明说明的,无实际意义 第六个字段:用户家目录 第七个字段:用户的shell(用户登录后,要启动一个进程,用来将用户下达的指令传给

Linux和window互传文件、用户配置文件和密码配置文件、用户组管理、用户管理

        Linux和window互传文件(前提使用:XShell.securecrt) linux -->window 1.安装 yum install -y lrzsz 安装后 使用命令#: sz +文件名 window-->linux 命令#:rz 传输成功  用户配置文件和密码配置文件 用户配置文件:/etc/passwd /etc/passwd 用户密码文件,当我们增加一个用户时,文件就会增加相应的一行内容. 第一个字段:为用户名 第二个字段:该用户的登录口令(密码,密码其实是

第三周第一节、linux和windows互传文件,用户配置文件和密码配置文件、用户及用户组管理

Linux和Windows互传文件 samba.ftp服务都可以实现Linux和Windows文件传输,平时我们使用的Xshell中也有一个命令可以实现Linux和Windows文件互传:首先我们要安装软件包:[[email protected] ~]# yum -y install lrzsz从Windows上传Linux一个文件:[[email protected] ~]# rz从Linux上传至Windows一个文件:[[email protected] ~]# sz anaconda-k