|
| 1 | += Upgrading HDFS |
| 2 | + |
| 3 | +IMPORTANT: HDFS upgrades are experimental, and details may change at any time |
| 4 | + |
| 5 | +HDFS currently requires a manual process to upgrade. This guide will take you through an example case, upgrading an example cluster (from our xref:getting_started/index.adoc[Getting Started] guide) from HDFS 3.3.6 to 3.4.0. |
| 6 | + |
| 7 | +== Preparing HDFS |
| 8 | + |
| 9 | +HDFS must be configured to initiate the upgrade process. To do this, run the following commands in a HDFS superuser environment |
| 10 | +(either a client configured with a superuser account, or from inside NameNode pod): |
| 11 | + |
| 12 | +[source,terminal] |
| 13 | +---- |
| 14 | +$ hdfs dfsadmin -rollingUpgrade prepare |
| 15 | +PREPARE rolling upgrade ... |
| 16 | +Preparing for upgrade. Data is being saved for rollback. |
| 17 | +Run "dfsadmin -rollingUpgrade query" to check the status |
| 18 | +for proceeding with rolling upgrade |
| 19 | + Block Pool ID: BP-841432641-10.244.0.29-1722612757853 |
| 20 | + Start Time: Fri Aug 02 15:49:12 GMT 2024 (=1722613752341) |
| 21 | + Finalize Time: <NOT FINALIZED> |
| 22 | +
|
| 23 | +$ # Then run query until the HDFS is ready to proceed |
| 24 | +$ hdfs dfsadmin -rollingUpgrade query |
| 25 | +QUERY rolling upgrade ... |
| 26 | +Preparing for upgrade. Data is being saved for rollback. |
| 27 | +Run "dfsadmin -rollingUpgrade query" to check the status |
| 28 | +for proceeding with rolling upgrade |
| 29 | + Block Pool ID: BP-841432641-10.244.0.29-1722612757853 |
| 30 | + Start Time: Fri Aug 02 15:49:12 GMT 2024 (=1722613752341) |
| 31 | + Finalize Time: <NOT FINALIZED> |
| 32 | +
|
| 33 | +$ # It should look like this once ready |
| 34 | +$ hdfs dfsadmin -rollingUpgrade query |
| 35 | +QUERY rolling upgrade ... |
| 36 | +Proceed with rolling upgrade: |
| 37 | + Block Pool ID: BP-841432641-10.244.0.29-1722612757853 |
| 38 | + Start Time: Fri Aug 02 15:49:12 GMT 2024 (=1722613752341) |
| 39 | + Finalize Time: <NOT FINALIZED> |
| 40 | +---- |
| 41 | + |
| 42 | +== Starting the upgrade |
| 43 | + |
| 44 | +Once ready, the HdfsCluster can be updated with the new product version: |
| 45 | + |
| 46 | +[source,terminal] |
| 47 | +---- |
| 48 | +$ kubectl patch hdfs/simple-hdfs --patch '{"spec": {"image": {"productVersion": "3.4.0"}}}' --type=merge |
| 49 | +hdfscluster.hdfs.stackable.tech/simple-hdfs patched |
| 50 | +---- |
| 51 | + |
| 52 | +Then wait until all pods are ready and running the new HDFS version. |
| 53 | + |
| 54 | +NOTE: Services will be upgraded in order: JournalNodes, then NameNodes, then DataNodes. |
| 55 | + |
| 56 | +== Finalizing the upgrade |
| 57 | + |
| 58 | +Once all HDFS pods are running the new version, the HDFS upgrade can be finalized (from the HDFS superuser environment): |
| 59 | + |
| 60 | +[source,terminal] |
| 61 | +---- |
| 62 | +$ hdfs dfsadmin -rollingUpgrade finalize |
| 63 | +FINALIZE rolling upgrade ... |
| 64 | +Rolling upgrade is finalized. |
| 65 | + Block Pool ID: BP-841432641-10.244.0.29-1722612757853 |
| 66 | + Start Time: Fri Aug 02 15:49:12 GMT 2024 (=1722613752341) |
| 67 | + Finalize Time: Fri Aug 02 15:58:39 GMT 2024 (=1722614319854) |
| 68 | +---- |
| 69 | + |
| 70 | +Finally, the operator and cluster should be taken out of upgrade mode, by marking the HdfsCluster as upgraded to the new version: |
| 71 | + |
| 72 | +[source,terminal] |
| 73 | +---- |
| 74 | +$ kubectl patch hdfs/simple-hdfs --subresource=status --patch '{"status": {"deployedProductVersion": "3.4.0"}}' --type=merge |
| 75 | +hdfscluster.hdfs.stackable.tech/simple-hdfs patched |
| 76 | +---- |
| 77 | + |
| 78 | +NOTE: The NameNodes will be restarted a final time, taking them out of upgrade mode. |
0 commit comments