How to copy a file into HDFS with a different block size to that of existing block size configuration?



How to copy a file into HDFS with a different block size to that of existing block size configuratio..

Answer / Shamee Ahmad

To copy a file into HDFS with a different block size, you can use the `-D dfs.blocksize` command line option with the `hadoop cp` or `hadoop fs -copyFromLocal` commands. Here's an example:

```bash
hadoop fs -copyFromLocal /local/path/to/file hdfs://namenode:port/hdfs/destination-path -D dfs.blocksize=<custom-block-size>
```
Replace `<custom-block-size>` with the desired block size in bytes, and update the path components accordingly.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apache HDFS Hadoop Distributed File System Interview Questions

What is hdfs block size?

1 Answers  


What are the difference between of the “HDFS Block” and “Input Split”?

1 Answers  


Explain hdfs?

1 Answers  


What is throughput in HDFS?

1 Answers  


If data is present in HDFS and RF is defined, then how can we change Replication Factor?

1 Answers  


How does hdfs give great throughput?

1 Answers  


Write command to copy a file from HDFS to linux(local).

1 Answers  


What happens if the block in HDFS is corrupted?

1 Answers  


Compare hbase vs hdfs?

1 Answers  


If the source data gets updated every now and then, how will you synchronize the data in hdfs that is imported by sqoop?

1 Answers  


List the files associated with metadata in hdfs?

1 Answers  


Define data integrity? How does hdfs ensure data integrity of data blocks stored in hdfs?

1 Answers  


Categories