docker run -it --name=ubuntu_hadoop -h charlie ubuntu-with-jdk
此时的容器是带有java版本的,可以输入java -version查看
安装常用工具
1 2 3
apt-get update apt-get install vim apt-get install wget
创建hadoop的目录
这里也和我所参考的文章保持一致,并下载hadoop安装包
1 2 3 4
mkdir -p /your/path/to/hadoop/ cd /your/path/to/hadoop wget http://mirrors.ustc.edu.cn/apache/hadoop/common/hadoop-3.2.4/hadoop-3.2.4.tar.gz tar -xvzf hadoop-3.2.4.tar.gz
$ start-all.sh Starting namenodes on [hadoop] ERROR: Attempting to operate on hdfs namenode as root ERROR: but there is no HDFS_NAMENODE_USER defined. Aborting operation. Starting datanodes ERROR: Attempting to operate on hdfs datanode as root FRROR. but there is no HDFS_DATANODE_USER defined. Aborting operation.
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. See accompanying LICENSE file. -->
<!-- Put site-specific property overrides in this file. --> <configuration> <property> <name>hadoop.tmp.dir</name> <value>/your/path/to/hadoop/hadoop-3.2.4/tmp</value> </property> <property> <name>fs.default.name</name> <value>hdfs://master:9000</value> <final>true</final> </property> </configuration>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. See accompanying LICENSE file. -->
<!-- Put site-specific property overrides in this file. -->
<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. See accompanying LICENSE file. -->
<!-- Put site-specific property overrides in this file. -->