Ubuntu18.04 Hadoop Pseudo-Distributed

sudo tar -zxvf hadoop-3.1.2.tar.gz -C /usr/local/
sudo mv hadoop-3.1.2/ ./hadoop
sudo chown -R hosea ./hadoop/
ls -al
vim ./etc/hadoop/hadoop-env.sh
export JAVA_HOME=/usr/local/jdk/jdk1.8.0_212
vim ./etc/hadoop/core-site.xml
<configuration>
        <property>
                <name>fs.defaultFS</name>
                <value>hdfs://localhost:9000</value>
        </property>
</configuration>
vim ./etc/hadoop/hdfs-site.xml
<configuration>
        <property>
                <name>dfs.replication</name>
                <value>1</value>
        </property>
</configuration>
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 0600 ~/.ssh/authorized_keys
./bin/hdfs namenode -format
./sbin/start-dfs.sh
./bin/hdfs dfs -mkdir /user
./bin/hdfs dfs -mkdir /user/hosea
./bin/hdfs dfs -mkdir input
./bin/hdfs dfs -put etc/hadoop/*.xml input
./bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-3.1.2.jar grep input output 'dfs[a-z.]+'
./bin/hdfs dfs -get output output
cat output/*
上一篇:java – 分布式数据聚合,查询,过滤:Hadoop / Mapreduce的任何替代框架? (MR太慢了)


下一篇:Java中具有到期控制的分布式缓存