在新节点上安装HDFS

  • 安装HDFS
hawq ssh -h caps3 -e 'yum install -y hadoop hadoop-hdfs'
  • 创建DataNode目录
hawq ssh -h caps3 -e 'mkdir -p /data1/hdfs/datanode'
hawq ssh -h caps3 -e 'mkdir -p /data2/hdfs/datanode'
hawq ssh -h caps3 -e 'chmod -R 755 /data1/hdfs'
hawq ssh -h caps3 -e 'chmod -R 755 /data2/hdfs'
hawq ssh -h caps3 -e 'chown -R hdfs:hadoop /data1/hdfs'
hawq ssh -h caps3 -e 'chown -R hdfs:hadoop /data2/hdfs'
  • 复制配置文件到caps3
hawq scp -r -h caps3 /etc/hadoop/conf =:/etc/hadoop/
  • 启动caps3上的DataNode
hawq ssh -h caps3 -e 'sudo -u hdfs /usr/hdp/current/hadoop-client/sbin/hadoop-daemon.sh start datanode'
  • 查看DataNode是否已经加入到集群
su - hdfs
hdfs dfsadmin -report

你也可以查看HDFS web界面:http://capm1:50070/