## What changes were proposed in this pull request?

An automation script that can be used to convert old style isilon clusters with 
HDFS service to the new mpack based structure. The script replaces HDFS service 
to ONEFS and all of the HDFS clients to ONEFS_CLIENT. Config types like 
core-site, hdfs-site, hadoop-env should be preserved. The script uses the 
ambari REST api to carry out the conversion.

All of the operations in the script are supposed to be idempotent so that the 
user can rerun the script multiple times in case of a failure.

These are the main steps (see Upgrade>>perform())
* Checks prerequisites (stack version, existence of ONEFS service in the stack)
* Collects all of the hosts where an HDFS_CLIENT is installed (and saves this 
into a file)
* Stops all services
* Downloads core-site, hdfs-site, hadoop-env (and saves these into a file)
* Delete HDFS service
* Add ONEFS service and ONEFS_CLIENT service component
* Adds core-site, hdfs-site, hadoop-env to ONEFS and sets the smart connect 
zone address
* Adds ONEFS_CLIENTs to all hosts where an HDFS_CLIENT was installed
* Starts all services

If the script fails after HDFS was deleted then the stored configs and hosts 
will be used when rerunning the script.

## How was this patch tested?

* Created a HDP 3.0 cluster with HDP and ZOOKEEPER
* Ran the script
* Checked that HDFS was deleted and all of the HDFS_CLIENTs were replaced to 
ONEFS_CLIENTs
* Checked core-site, hadoop-env, hdfs-site, and onefs/smartconnectzone address

```txt
$ python ambari-isilon-upgrade.py --host=c7401 --port=8080 --protocol=http 
--cluster=cc --user=admin --password=admin
This script will replace the HDFS service to ONEFS
The following prerequisites are required:
  * ONEFS management package must be installed
  * Ambari must be upgraded to >=v2.7.0
  * Stack must be upgraded to HDP-3.0
  * Is highly recommended to backup ambari database before you proceed.
Checking Cluster: cc (http://c7401:8080/api/v1/clusters/cc)
Found stack HDP-3.0
Please, confirm you have made backup of the Ambari db [y/n] (n)? y
Collecting hosts with HDFS_CLIENT
Found hosts [u'c7401.ambari.apache.org', u'c7402.ambari.apache.org', 
u'c7403.ambari.apache.org']
Stopping all services..
Downloading core-site..
Downloading hdfs-site..
Downloading hadoop-env..
Deleting HDFS..
Adding ONEFS..
Adding ONEFS config..
Adding core-site
Adding hdfs-site
Adding hadoop-env-site
Adding ONEFS_CLIENT to hosts: [u'c7401.ambari.apache.org', 
u'c7402.ambari.apache.org', u'c7403.ambari.apache.org']
Starting all services..
```

cc: @ro-ket 

[ Full content available at: https://github.com/apache/ambari/pull/2397 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to