【hadoop0001】hadoop环境搭建

来源:互联网 发布:请问在淘宝怎么开店 编辑:程序博客网 时间:2024/06/05 18:02

一 jdk环境变量

用文本编辑器打开/etc/profile
在profile文件末尾加入:

export JAVA_HOME=/usr/share/jdk1.6.0_14 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 

保存后,记着执行,source /etc/profile 把文件再执行一遍

二 CentOS下搭建Perl环境

1、安装gcc环境

yum install gccyum install gcc-c++yum install make

2、安装Perl环境
yum install perl*
这个命令基本上把perl的模块给安装齐了。
yum install cpan
CPAN这个就不用说了吧,大家都懂。

如果你对perl模块版本要求比较高,希望是新版的那么请按照一下安装:

yum install perlyum install cpan

以后有什么需要直接用cpan编译安装。

1 配置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>hadoop.tmp.dir</name><value>/hadoop</value><description>A base for other temporary directories.</description></property><property><name>fs.default.name</name><value>hdfs://centos2:9000</value><description>The name of the default file system. A URI whose scheme and autority determine the FuleSystem inplementation. The uri's scheme determines the config property (fs.SCHEME.impl) naming the FileSystem implementation class. The uri's authority is used to determine the host, port,etc. for a filesystem.</description></property><property><name>dfs.name.dir</name><value>/hadoop/name</value><description> Deters where on the local filesystem the DFS name note should store the name table. If this is a comma-delimited list of directories then the name table is replicated in all of the directories , for redundancy.</description></property></configuration>
2 配置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.data.dir</name><value>/hadoop/data</value><description> Determines where on the local filesystem the DFS name note should store the name table. If this is a comma-delimited list of directories then the name table is replicated in all of the directories . typically on different devices. Directories that do not exist are ignored.</description></property><property><name>dfs.replication</name><value>1</value><description>Default blick replication. The actual number of the replication can be specified when the file is created. The default is used if replication is not spcified in create time.</description></property></configuration>
3 配置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>localhost.localdomain:9001</value><description> The host and port that the MR job tracker runs at. if local , then jobs are run in-process as a single map and reduce task</description></property></configuration>

四 关闭防火墙命令

iptables -Fsetenforce 0 
0 0
原创粉丝点击