您的位置:首页 > 运维架构 > Linux

centos下安装hadoop

2015-07-21 14:39 316 查看


安装wget 
yum install -y wget
下载 wget http://mirror.bit.edu.cn/apache/hadoop/common/hadoop-1.2.1/hadoop-1.2.1.tar.gz 解压  
tar -zxvf hadoop-1.2.1.tar.gz

配置文件
hadoop-1.2.1/conf 目录下
hadoop.env.sh
export JAVA_HOME=/usr/java/jdk1.8.0_45
core-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->

<configuration>
<!—- hadoop工作目录 -—>
<property>
<name>hadoop.tmp.dir</name>
<value>/hadoop</value>
</property>

<!—- 源数据目录 -—>
<property>
<name>dfs.name.dir</name>
<value>/hadoop/name</value>
</property>

<!—- 访问路径 -—>
<property>
<name>fs.default.name</name>
<value>hdfs://cas:9000</value>
</property>

</configuration>

hdfs-sit.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>/hadoop/data</value>

</property>

</configuration>
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>cas:9001</value>

</property>
</configuration>

格式化操作 hadoop namenode -format
jps
查看文件 
hadoop fs -ls /
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: