3
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Hadoopを構築するまで

Last updated at Posted at 2016-07-16

自分用のmemoです

環境

  • CentOS 7.2
  • VirtualBox 5.0.2
  • Hadoop 2.7.2
  • Hive 2.1.0

Hadoop構築

Javaインストール

$ yum -y update
$ yum -y groupinstall 'Development tools'
$ wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u66-b17/jdk-8u66-linux-x64.rpm
$ rpm -ivh jdk-8u66-linux-x64.rpm
$ export JAVA_HOME=/usr/java/jdk1.8.0_66
$ source .bashrc

Hadoopインストール

$ wget http://ftp.riken.jp/net/apache/hadoop/common/hadoop-2.7.2/hadoop-2.7.2.tar.gz 
$ tar -xzvf hadoop-2.7.2.tar.gz 
$ mv hadoop-2.7.2 /usr/
$ export HADOOP_HOME=/usr/hadoop-2.7.2
$ export PATH=$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$JAVA_HOME/bin:$PATH
$ source .bashrc

設定ファイル編集

  • etc/hadoop/core-site.xml:
<configuration>
    <property>
        <name>fs.defaultFS</name>
        <value>hdfs://localhost:9000</value>
    </property>
</configuration>
  • etc/hadoop/hdfs-site.xml:
<configuration>
    <property>
        <name>dfs.replication</name>
        <value>1</value>
    </property>
</configuration>
  • etc/hadoop/mapred-site.xml:
<configuration>
    <property>
        <name>mapreduce.framework.name</name>
        <value>yarn</value>
    </property>
</configuration>
  • etc/hadoop/yarn-site.xml:
<configuration>
    <property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value>
    </property>
</configuration>

起動

$ hadoop namenode -format
$ start-dfs.sh
$ start-yarn.sh

起動確認

$ jps

28962 NodeManager
28868 ResourceManager
28713 SecondaryNameNode
28554 DataNode
29245 Jps
28431 NameNode

Hive構築

インストール

$ wget http://ftp.riken.jp/net/apache/hive/hive-2.1.0/apache-hive-2.1.0-bin.tar.gz
$ tar -xzvf apache-hive-2.1.0-bin.tar.gz
$ mv apache-hive-2.1.0-bin /usr/hive-2.1.0
$ export HIVE_HOME=/usr/hive-2.1.0
$ export PATH=$PATH:$HIVE_HOME/bin
$ souce .bashrc

ここでhive実行後エラー、、、
よくわからないが、以下を試したらOKだった

$ mv metastore_db metastore_db.tmp
$ schematool -initSchema -dbType derby
$ hive
3
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?