Hadoop runs in three forms:
FromHadoop download homepageChoose the appropriate version to download Hadoop.
An example of the command is as follows:
HADOOP_VERSION=hadoop-3.0.0-alpha1
wget http://apache.fayea.com/hadoop/common/${HADOOP_VERSION}/${HADOOP_VERSION}.tar.gz
wget https://dist.apache.org/repos/dist/release/hadoop/common/${HADOOP_VERSION}/${HADOOP_VERSION}.tar.gz.mds
wget https://dist.apache.org/repos/dist/release/hadoop/common/${HADOOP_VERSION}/${HADOOP_VERSION}.tar.gz.asc
wget https://dist.apache.org/repos/dist/release/hadoop/common/KEYS
verification
The command performs similarly as follows:
HADOOP_VERSION=hadoop-3.0.0-alpha1
md5 ${HADOOP_VERSION}.tar.gz | awk '{print $4}' > mycomputation.md5
sed -n '1,2p' ${HADOOP_VERSION}.tar.gz.mds | sed 's/[ ]//g' | awk -v RS="" -F= '{gsub("\n","");print tolower($2)}' > extraction.md5
diff mycomputation.md5 extraction.md5
gpg -q --import KEYS
gpg --verify ${HADOOP_VERSION}.tar.gz.asc ${HADOOP_VERSION}.tar.gz
Decompression
Verify that the downloaded file is extracted and goes to its root directory.
The command performs similarly as follows:
HADOOP_VERSION=hadoop-3.0.0-alpha1
tar xzvf ${HADOOP_VERSION}.tar.gz
cd ${HADOOP_VERSION}
Change settingJAVA_HOME。
note:
is by modifying the fileetc/hadoop/hadoop-env.shmiddleJAVA_HOMEAttribute variable.
The example is as follows:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/
By executionbin/hadoop
execute the commandbin/hadoopNormally, you should display the hadoop command usage documentation.
Run the map reduce task
Execute the following command:
mkdir input
cp etc/hadoop/*.xml input
bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-3.0.0-alpha1.jar grep input output 'dfs[a-z.]+'
cat output/*
Edit fileetc/hadoop/core-site.xml:
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
Edit fileetc/hadoop/hdfs-site.xml:
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
Execute the following command:
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 0600 ~/.ssh/authorized_keys
Format the file system:
bin/hdfs namenode -format
Start the NameNode daemon and the DataNode daemon:
sbin/start-dfs.sh
Write the log$HADOOP_LOG_DIRDirectory (default is$HADOOP_HOME/logs)。
Create an HDFS directory to perform MapReduce tasks:
bin/hdfs dfs -mkdir /user
bin/hdfs dfs -mkdir /user/zhengfq
Copy the input file to the distributed file system:
bin/hdfs dfs -mkdir input
bin/hdfs dfs -put etc/hadoop/*.xml input
Running example:
bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-3.0.0-alpha1.jar grep input output 'dfs[a-z.]+'
Check the output:
bin/hdfs dfs -cat output/*
Stop the process:
sbin/stop-dfs.sh
Reprinted at: https://www.jianshu.com/p/e450fe10d003
definition: Big data refers to a collection of data that cannot be captured, managed, and processed with commonly used software tools within a certain time frame, and requires new processing The model...
Introduction to Zookeeper Is a distributed, open source distributed application coordination service It is used to ensure the transaction consistency of data in the cluster key Zookeeper application s...
1. Introduction to Hadoop Pig Second, PIG installation and configuration: 1.PIG installation conditions (1).Hadoop Pig has two run modes: local mode and MapReduce mode. If you need a job to run in a d...
Big Data What is big data? For the "big data" (Big data, Mega data), also known as Big Data. Research firm Gartner gives this definition: "Big Data" is the need for new processing ...
1、HadoopBackground What is Hadoop: 1. HADOOP is an open source apache'ssoftware platform 2. HADOOP functions provided: the use of a server cluster according to the user's custom business logic,Distrib...
Hadoop-Introduction Hadoop can run on general commercial servers, with high fault tolerance, high reliability, high scalability, etc. Especially suitable for writing once and reading many times Suitab...
Introduction to hadoop: Hadoop platform is a reliable, scalable, and distributed computing open source software. The Apache Hadoop platform is a framework that allows the use of simple programming mod...
Because the article is too long, the rest is in my other blogs! Part II: HDFS Part III: MapReduce Part IV: Project Cases 《Hadoop》 Hadoop common command command Description jps View process service ipt...
1, must bind the host name and IP, otherwise the remote will not connect vi /etc/hosts 2, set ssh free login (1) ssh-keygen, always enter (2)ssh-copy-id localhost 3, install Java (1) Install jdk1.8: (...
The first section of the Hadoop infrastructure configuration 1.0 pre-action: Make the ordinary user I created get administrator rights is as follows 1) Switch to the administrator user, the switching ...