#準備3臺centos7電腦。並配置無密碼登陸java
1.安裝java1.8.144node
2.編譯環境c++
yum install cmake lzo-devel zlib-devel gcc gcc-c++ autoconf automake libtool ncurses-devel openssl-devel libXtst
3.安裝protobufweb
下載protobuf-2.5.0,不能用高版本,不然Hadoop編譯不能經過
wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gzapache
tar xvf protobuf-2.5.0.tar.gz cd protobuf-2.5.0 ./configure make make install ldconfig protoc --version
4.安裝mavencentos
wget http://mirror.bit.edu.cn/apache/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.tar.gz tar -zxvf apache-maven-3.5.0-bin.tar.gz vi /etc/profile export MAVEN_HOME=/opt/apache-maven-3.5.0 export PATH=$PATH:$MAVEN_HOME/bin
在maven的settings.xml 文件裏配置mirrors的子節點,添加以下mirrormaven
<mirror> <id>nexus-aliyun</id> <mirrorOf>*</mirrorOf> <name>Nexus aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public</url> </mirror>
5.下載hadoop2.7.3,編譯oop
tar -zxvf hadoop-2.7.3-src.tar.gz mvn package -DskipTests -Pdist,native -Dtar
6.ui
vi etc/hadoop/core-site.xml <configuration> <property> <name>fs.defaultFS</name> <value>hdfs://hbase1:9000</value> </property> <property> <name>hadoop.tmp.dir</name> <value>/mnt/hadoop/hdfs/tmp</value> </property> </configuration>
vi etc/hadoop/hdfs-site.xml <configuration> <property> <name>dfs.replication</name> <value>3</value> </property> <property> <name>dfs.namenode.name.dir</name> <value>/mnt/hadoop/hdfs/name,/opt/namenode_bak</value> <description></description> </property> <property> <name>dfs.datanode.data.dir</name> <value>/mnt/hadoop/hdfs/data</value> <description></description> </property> <property> <name>dfs.http.address</name> <value>hbase1:50070</value> <description> The address and the base port where the dfs namenode web ui will listen on. If the port is 0 then the server will start on a free port. </description> </property> <property> <name>dfs.webhdfs.enabled</name> <value>true</value> </property> <property> <name>dfs.namenode.secondary.http-address</name> <value>storm1:50090</value> </property> </configuration>
vi slaves
格式 namenodegoogle
hadoop namenode -format