Big data study notes (3) - hadoop demo operation [original]

1. Create two text files as test data
mkdir -p /home/zhenggm/input
cd /home/zhenggm/input
echo "hello hadoop bye hadoop" > f1
echo "hello hadoop bye hadoop" > f2

2. Create hdfs directory
hadoop fs -mkdir -p /tmp/input

3. Copy the file to hdfs
hadoop fs -put /home/zhenggm/input/* /tmp/input/

4. Run the demo program
cd /usr/local/hadoop-2.7.3
hadoop jar ./share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.3.jar wordcount /tmp/input /tmp/output


5. View the result directory


6. View the statistical results

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326665925&siteId=291194637