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.1localhost#127.0.1.1node1#-------edit by HY(2014-05-04)---
本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
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>
<?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
每台机器配置都要一样

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

热门话题

如果你从移动运营商处购买了笔记本电脑,则很可能可以选择激活eSIM并使用手机网络将计算机连接到Internet。有了eSIM,您无需将另一张物理SIM卡插入笔记本电脑,因为它已经内置。当您的设备无法连接到网络时,它非常有用。如何检查我的Windows11设备是否兼容eSIM卡?单击“开始”按钮,然后转到“网络和互联网”>“蜂窝>设置”。如果您没有看到“蜂窝移动网络”选项,则您的设备没有eSIM功能,您应该选中其他选项,例如使用移动设备将笔记本电脑连接到热点。为了激活和

为什么要写配置文件这个固定文件我们可以直接写成一个 .py 文件,例如 settings.py 或 config.py,这样的好处就是能够在同一工程下直接通过 import 来导入当中的部分;但如果我们需要在其他非 Python 的平台进行配置文件共享时,写成单个 .py 就不是一个很好的选择。这时我们就应该选择通用的配置文件类型来作为存储这些固定的部分。目前常用且流行的配置文件格式类型主要有 ini、json、toml、yaml、xml 等,这些类型的配置文件我们都可以通过标准库或第三方库来进

Java错误:Hadoop错误,如何处理和避免当使用Hadoop处理大数据时,常常会遇到一些Java异常错误,这些错误可能会影响任务的执行,导致数据处理失败。本文将介绍一些常见的Hadoop错误,并提供处理和避免这些错误的方法。Java.lang.OutOfMemoryErrorOutOfMemoryError是Java虚拟机内存不足的错误。当Hadoop任

设置无线网络很常见,但选择或更改网络类型可能会令人困惑,尤其是在您不知道后果的情况下。如果您正在寻找有关如何在Windows11中将网络类型从公共更改为私有或反之亦然的建议,请继续阅读以获取一些有用的信息。Windows11中有哪些不同的网络配置文件?Windows11附带了许多网络配置文件,这些配置文件本质上是可用于配置各种网络连接的设置集。如果您在家中或办公室有多个连接,这将非常有用,因此您不必每次连接到新网络时都进行所有设置。专用和公用网络配置文件是Windows11中的两种常见类型,但通

最近有不少Win10系统的用户想要更改用户配置文件,但不清楚具体如何操作,本文将给大家带来Win10系统设置用户配置文件的操作方法吧!Win10如何设置用户配置文件1、首先,按下“Win+I”键打开设置界面,并点击进入到“系统”设置。2、接着,在打开的界面中,点击左侧的“关于”,再找到并点击其中的“高级系统设置”。3、然后,在弹出的窗口中,切换到“”选项栏,并点击下方“用户配

为什么要写配置文件在开发过程中,我们常常会用到一些固定参数或者是常量。对于这些较为固定且常用到的部分,往往会将其写到一个固定文件中,避免在不同的模块代码中重复出现从而保持核心代码整洁。这个固定文件我们可以直接写成一个 .py 文件,例如 settings.py 或 config.py,这样的好处就是能够在同一工程下直接通过 import 来导入当中的部分;但如果我们需要在其他非 Python 的平台进行配置文件共享时,写成单个 .py 就不是一个很好的选择。这时我们就应该选择通用的配置文件类型来

Helm是Kubernetes的一个重要组件,它通过将配置文件捆绑到一个称为HelmChart的包中来简化Kubernetes应用程序的部署。这种方法使得更新单个配置文件比修改多个文件更加便捷。借助Helm,用户可以轻松地部署Kubernetes应用程序,简化了整个部署过程,提高了效率。在本指南中,我将介绍在Ubuntu上实现Helm的不同方法。请注意:以下指南中的命令适用于Ubuntu22.04以及所有Ubuntu版本和基于Debian的发行版。这些命令经过测试,应该在您的系统上正常运行。在U

解决eclipse乱码问题的有效方法,需要具体代码示例近年来,随着软件开发的飞速发展,eclipse作为最受欢迎的集成开发环境之一,为众多开发者提供了便利和高效。然而,使用eclipse时可能会遇到乱码问题,这对于项目开发和代码阅读带来了困扰。本文将介绍一些解决eclipse乱码问题的有效方法,并提供具体代码示例。修改eclipse文件编码设置:在eclip
