centos

centos hdfs如何测试配置

小樊
48
2025-02-19 02:57:05
栏目: 智能运维

在CentOS上测试Hadoop HDFS配置的步骤如下:

  1. 格式化NameNode(仅首次配置时需要):
hdfs namenode -format
  1. 启动HDFS集群
./sbin/start-dfs.sh
  1. 停止HDFS集群
./sbin/stop-dfs.sh
  1. 检查HDFS状态

使用以下命令检查HDFS的状态,确保NameNode和DataNode都在运行:

hdfs dfsadmin -report
  1. 使用HDFS命令行工具测试配置
hdfs dfs -mkdir /testDir
hdfs dfs -put /local/path/to/file.txt /hdfs/path/
hdfs dfs -get /hdfs/path/file.txt /local/path/to/download
hdfs dfs -ls /
hdfs fs -test -e /hdfs/path/to/file

0
看了该问题的人还看了