You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ji...@apache.org on 2024/09/07 09:44:59 UTC

(ambari) 08/22: add router

This is an automated email from the ASF dual-hosted git repository.

jialiang pushed a commit to branch eee
in repository https://gitbox.apache.org/repos/asf/ambari.git

commit c1669f3037594893060c860caebf4820efa9845e
Author: jialiang <ji...@gmail.com>
AuthorDate: Fri Sep 6 17:13:59 2024 +0800

    add router
---
 ambari-server/src/main/python/bootstrap.py         |   6 +-
 .../BIGTOP/3.2.0/properties/stack_packages.json    |  12 +
 .../services/HDFS/configuration/hdfs-rbf-site.xml  | 771 +++++++++++++++++++++
 .../BIGTOP/3.2.0/services/HDFS/kerberos.json       |  26 +
 .../stacks/BIGTOP/3.2.0/services/HDFS/metainfo.xml |  46 ++
 .../services/HDFS/package/scripts/dfsrouter.py     | 143 ++++
 .../3.2.0/services/HDFS/package/scripts/hdfs.py    |   9 +
 .../services/HDFS/package/scripts/hdfs_router.py   |  91 +++
 .../services/HDFS/package/scripts/params_linux.py  |  33 +
 .../3.2.0/services/HDFS/package/scripts/utils.py   |  16 +
 ambari-web/app/controllers.js                      |   5 +
 .../routerBasedFederation/step1_controller.js      |  26 +
 .../routerBasedFederation/step2_controller.js      |  67 ++
 .../routerBasedFederation/step3_controller.js      | 191 +++++
 .../routerBasedFederation/step4_controller.js      |  80 +++
 .../routerBasedFederation/wizard_controller.js     | 158 +++++
 .../main/admin/highAvailability_controller.js      |  22 +
 ambari-web/app/controllers/main/service/item.js    |   5 +
 .../wizards/router_federation_properties.js        |  80 +++
 ambari-web/app/data/controller_route.js            |   4 +
 ambari-web/app/locales/default_messages.js         |  22 +
 .../app/mixins/wizard/assign_master_components.js  |   3 +
 ambari-web/app/models/host_component.js            |   6 +
 ambari-web/app/models/service.js                   |   2 +-
 .../app/routes/dfsrouter_federation_routes.js      | 166 +++++
 ambari-web/app/routes/main.js                      |   2 +
 .../federation/routerBasedFederation/step1.hbs     |  28 +
 .../federation/routerBasedFederation/step3.hbs     |  56 ++
 .../federation/routerBasedFederation/step4.hbs     |  19 +
 .../federation/routerBasedFederation/wizard.hbs    |  35 +
 ambari-web/app/utils/db.js                         |   1 +
 ambari-web/app/views.js                            |   5 +
 .../federation/routerBasedFederation/step1_view.js |  28 +
 .../federation/routerBasedFederation/step2_view.js |  25 +
 .../federation/routerBasedFederation/step3_view.js |  31 +
 .../federation/routerBasedFederation/step4_view.js |  35 +
 .../routerBasedFederation/wizard_view.js           |  32 +
 ambari-web/app/views/main/service/item.js          |   7 +
 ambari-web/test/models/service_test.js             |   2 +-
 39 files changed, 2291 insertions(+), 5 deletions(-)

diff --git a/ambari-server/src/main/python/bootstrap.py b/ambari-server/src/main/python/bootstrap.py
index 7b3e36bd78..13aed53801 100755
--- a/ambari-server/src/main/python/bootstrap.py
+++ b/ambari-server/src/main/python/bootstrap.py
@@ -345,7 +345,7 @@ class BootstrapWindows(Bootstrap):
     user_run_as = self.shared_state.user_run_as
     server = self.shared_state.ambari_server
     version = self.getAmbariVersion()
-    return ' '.join(['python', setupFile, expected_hostname, passphrase, server, user_run_as, version])
+    return ' '.join(['python3', setupFile, expected_hostname, passphrase, server, user_run_as, version])
 
   def runSetupAgent(self):
     self.host_log.write("==========================\n")
@@ -609,7 +609,7 @@ class BootstrapDefault(Bootstrap):
     version = self.getAmbariVersion()
     port = self.getAmbariPort()
     passwordFile = self.getPasswordFile()
-    return "{sudo} -S python ".format(sudo=AMBARI_SUDO) + str(setupFile) + " " + str(expected_hostname) + \
+    return "{sudo} -S python3 ".format(sudo=AMBARI_SUDO) + str(setupFile) + " " + str(expected_hostname) + \
            " " + str(passphrase) + " " + str(server)+ " " + quote_bash_args(str(user_run_as)) + " " + str(version) + \
            " " + str(port) + " < " + str(passwordFile)
 
@@ -620,7 +620,7 @@ class BootstrapDefault(Bootstrap):
     user_run_as = self.shared_state.user_run_as
     version=self.getAmbariVersion()
     port=self.getAmbariPort()
-    return "{sudo} python ".format(sudo=AMBARI_SUDO) + str(setupFile) + " " + str(expected_hostname) + \
+    return "{sudo} python3 ".format(sudo=AMBARI_SUDO) + str(setupFile) + " " + str(expected_hostname) + \
            " " + str(passphrase) + " " + str(server)+ " " + quote_bash_args(str(user_run_as)) + " " + str(version) + \
            " " + str(port)
 
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/properties/stack_packages.json b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/properties/stack_packages.json
index 93a335202c..5f5f64980e 100644
--- a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/properties/stack_packages.json
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/properties/stack_packages.json
@@ -187,6 +187,18 @@
             "hadoop-hdfs-namenode"
           ]
         },
+        "ROUTER": {
+          "STACK-SELECT-PACKAGE": "hadoop-hdfs-dfsrouter",
+          "INSTALL": [
+            "hadoop-hdfs-dfsrouter"
+          ],
+          "PATCH": [
+            "hadoop-hdfs-dfsrouter"
+          ],
+          "STANDARD": [
+            "hadoop-hdfs-dfsrouter"
+          ]
+        },
         "JOURNALNODE": {
           "STACK-SELECT-PACKAGE": "hadoop-hdfs-journalnode",
           "INSTALL": [
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/configuration/hdfs-rbf-site.xml b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/configuration/hdfs-rbf-site.xml
new file mode 100644
index 0000000000..6088b51112
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/configuration/hdfs-rbf-site.xml
@@ -0,0 +1,771 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<!-- Put site-specific property overrides in this file. -->
+<configuration supports_final="true">
+    <property>
+        <name>dfs.federation.router.rpc.enable</name>
+        <value>true</value>
+        <value-attributes>
+            <type>boolean</type>
+        </value-attributes>
+        <description>
+            If true, the RPC service to handle client requests in the router is
+            enabled.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.rpc-address</name>
+        <value>0.0.0.0:20010</value>
+        <description>
+            RPC address that handles all clients requests.
+            The value of this property will take the form of router-host1:rpc-port.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.rpc-bind-host</name>
+        <value>0.0.0.0</value>
+        <description>
+            The actual address the RPC server will bind to. If this optional address is
+            set, it overrides only the hostname portion of
+            dfs.federation.router.rpc-address. This is useful for making the name node
+            listen on all interfaces by setting it to 0.0.0.0.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.handler.count</name>
+        <value>10</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            The number of server threads for the router to handle RPC requests from
+            clients.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.handler.queue.size</name>
+        <value>100</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            The size of the queue for the number of handlers to handle RPC client requests.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.reader.count</name>
+        <value>1</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            The number of readers for the router to handle RPC client requests.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.reader.queue.size</name>
+        <value>100</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            The size of the queue for the number of readers for the router to handle RPC client requests.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.connection.creator.queue-size</name>
+        <value>100</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            Size of async connection creator queue.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.connection.pool-size</name>
+        <value>1</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            Size of the pool of connections from the router to namenodes.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.connection.min-active-ratio</name>
+        <value>0.5f</value>
+        <description>
+            Minimum active ratio of connections from the router to namenodes.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.connection.clean.ms</name>
+        <value>10000</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            Time interval, in milliseconds, to check if the connection pool should
+            remove unused connections.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.connection.pool.clean.ms</name>
+        <value>60000</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            Time interval, in milliseconds, to check if the connection manager should
+            remove unused connection pools.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.metrics.enable</name>
+        <value>true</value>
+        <value-attributes>
+            <type>boolean</type>
+        </value-attributes>
+        <description>
+            If the metrics in the router are enabled.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+
+    <property>
+        <name>dfs.federation.router.dn-report.time-out</name>
+        <value>1000</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            Time out, in milliseconds for getDatanodeReport.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.dn-report.cache-expire</name>
+        <value>10s</value>
+        <description>
+            Expiration time in seconds for datanodereport.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.metrics.class</name>
+        <value>org.apache.hadoop.hdfs.server.federation.metrics.FederationRPCPerformanceMonitor</value>
+        <description>
+            Class to monitor the RPC system in the router. It must implement the
+            RouterRpcMonitor interface.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.admin.enable</name>
+        <value>true</value>
+        <value-attributes>
+            <type>boolean</type>
+        </value-attributes>
+        <description>
+            If true, the RPC admin service to handle client requests in the router is
+            enabled.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.admin-address</name>
+        <value>0.0.0.0:8111</value>
+        <description>
+            RPC address that handles the admin requests.
+            The value of this property will take the form of router-host1:rpc-port.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.admin-bind-host</name>
+        <value>0.0.0.0</value>
+        <description>
+            The actual address the RPC admin server will bind to. If this optional
+            address is set, it overrides only the hostname portion of
+            dfs.federation.router.admin-address. This is useful for making the name
+            node listen on all interfaces by setting it to 0.0.0.0.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.admin.handler.count</name>
+        <value>1</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            The number of server threads for the router to handle RPC requests from
+            admin.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.http-address</name>
+        <value>0.0.0.0:50071</value>
+        <description>
+            HTTP address that handles the web requests to the Router.
+            The value of this property will take the form of router-host1:http-port.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.http-bind-host</name>
+        <value>0.0.0.0</value>
+        <description>
+            The actual address the HTTP server will bind to. If this optional
+            address is set, it overrides only the hostname portion of
+            dfs.federation.router.http-address. This is useful for making the name
+            node listen on all interfaces by setting it to 0.0.0.0.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.https-address</name>
+        <value>0.0.0.0:50072</value>
+        <description>
+            HTTPS address that handles the web requests to the Router.
+            The value of this property will take the form of router-host1:https-port.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.https-bind-host</name>
+        <value>0.0.0.0</value>
+        <description>
+            The actual address the HTTPS server will bind to. If this optional
+            address is set, it overrides only the hostname portion of
+            dfs.federation.router.https-address. This is useful for making the name
+            node listen on all interfaces by setting it to 0.0.0.0.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.http.enable</name>
+        <value>true</value>
+        <value-attributes>
+            <type>boolean</type>
+        </value-attributes>
+        <description>
+            If the HTTP service to handle client requests in the router is enabled.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.file.resolver.client.class</name>
+        <value>org.apache.hadoop.hdfs.server.federation.resolver.MountTableResolver</value>
+        <description>
+            Class to resolve files to subclusters. To enable multiple subclusters for a mount point,
+            set to org.apache.hadoop.hdfs.server.federation.resolver.MultipleDestinationMountTableResolver.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.namenode.resolver.client.class</name>
+        <value>org.apache.hadoop.hdfs.server.federation.resolver.MembershipNamenodeResolver</value>
+        <description>
+            Class to resolve the namenode for a subcluster.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.store.enable</name>
+        <value>true</value>
+        <value-attributes>
+            <type>boolean</type>
+        </value-attributes>
+        <description>
+            If true, the Router connects to the State Store.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.store.serializer</name>
+        <value>org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreSerializerPBImpl</value>
+        <description>
+            Class to serialize State Store records.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.store.driver.class</name>
+        <value>org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreZooKeeperImpl</value>
+        <description>
+            Class to implement the State Store. There are three implementation classes currently
+            being supported:
+            org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreFileImpl,
+            org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreFileSystemImpl and
+            org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreZooKeeperImpl.
+            These implementation classes use the local file, filesystem and ZooKeeper as a backend respectively.
+            By default it uses the ZooKeeper as the default State Store.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.store.connection.test</name>
+        <value>60000</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            How often to check for the connection to the State Store in milliseconds.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.cache.ttl</name>
+        <value>1m</value>
+        <description>
+            How often to refresh the State Store caches in milliseconds. This setting
+            supports multiple time unit suffixes as described in
+            dfs.heartbeat.interval. If no suffix is specified then milliseconds is
+            assumed.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.store.membership.expiration</name>
+        <value>300000</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            Expiration time in milliseconds for a membership record.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.store.membership.expiration.deletion</name>
+        <value>-1</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            Deletion time in milliseconds for a membership record. If an expired
+            membership record exists beyond this time, it will be deleted. If this
+            value is negative, the deletion is disabled.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.heartbeat.enable</name>
+        <value>true</value>
+        <value-attributes>
+            <type>boolean</type>
+        </value-attributes>
+        <description>
+            If true, the Router heartbeats into the State Store.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.heartbeat.interval</name>
+        <value>5000</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            How often the Router should heartbeat into the State Store in milliseconds.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.heartbeat-state.interval</name>
+        <value>5s</value>
+        <description>
+            How often the Router should heartbeat its state into the State Store in
+            milliseconds. This setting supports multiple time unit suffixes as
+            described in dfs.federation.router.quota-cache.update.interval.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.namenode.heartbeat.enable</name>
+        <value>true</value>
+        <value-attributes>
+            <type>boolean</type>
+        </value-attributes>
+        <description>
+            If true, get namenode heartbeats and send into the State Store.
+            If not explicitly specified takes the same value as for
+            dfs.federation.router.heartbeat.enable.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.store.router.expiration</name>
+        <value>5m</value>
+        <description>
+            Expiration time in milliseconds for a router state record. This setting
+            supports multiple time unit suffixes as described in
+            dfs.federation.router.quota-cache.update.interval.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.store.router.expiration.deletion</name>
+        <value>-1</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            Deletion time in milliseconds for a router state record. If an expired
+            router state record exists beyond this time, it will be deleted. If this
+            value is negative, the deletion is disabled.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.safemode.enable</name>
+        <value>true</value>
+        <value-attributes>
+            <type>boolean</type>
+        </value-attributes>
+        <description>
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.safemode.extension</name>
+        <value>30s</value>
+        <description>
+            Time after startup that the Router is in safe mode. This setting
+            supports multiple time unit suffixes as described in
+            dfs.heartbeat.interval. If no suffix is specified then milliseconds is
+            assumed.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.safemode.expiration</name>
+        <value>3m</value>
+        <description>
+            Time without being able to reach the State Store to enter safe mode. This
+            setting supports multiple time unit suffixes as described in
+            dfs.heartbeat.interval. If no suffix is specified then milliseconds is
+            assumed.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.monitor.localnamenode.enable</name>
+        <value>true</value>
+        <value-attributes>
+            <type>boolean</type>
+        </value-attributes>
+        <description>
+            If true, the Router should monitor the namenode in the local machine.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.mount-table.max-cache-size</name>
+        <value>10000</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            Maximum number of mount table cache entries to have.
+            By default, remove cache entries if we have more than 10k.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.mount-table.cache.enable</name>
+        <value>true</value>
+        <value-attributes>
+            <type>boolean</type>
+        </value-attributes>
+        <description>
+            Set to true to enable mount table cache (Path to Remote Location cache).
+            Disabling the cache is recommended when a large amount of unique paths are queried.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.quota.enable</name>
+        <value>false</value>
+        <value-attributes>
+            <type>boolean</type>
+        </value-attributes>
+        <description>
+            Set to true to enable quota system in Router. When it's enabled, setting
+            or clearing sub-cluster's quota directly is not recommended since Router
+            Admin server will override sub-cluster's quota with global quota.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.quota-cache.update.interval</name>
+        <value>60s</value>
+        <description>
+            Interval time for updating quota usage cache in Router.
+            This property is used only if the value of
+            dfs.federation.router.quota.enable is true.
+            This setting supports multiple time unit suffixes as described
+            in dfs.heartbeat.interval. If no suffix is specified then milliseconds
+            is assumed.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.client.thread-size</name>
+        <value>32</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            Max threads size for the RouterClient to execute concurrent
+            requests.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.client.retry.max.attempts</name>
+        <value>3</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            Max retry attempts for the RouterClient talking to the Router.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.client.reject.overload</name>
+        <value>false</value>
+        <value-attributes>
+            <type>boolean</type>
+        </value-attributes>
+        <description>
+            Set to true to reject client requests when we run out of RPC client
+            threads.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.client.allow-partial-listing</name>
+        <value>true</value>
+        <value-attributes>
+            <type>boolean</type>
+        </value-attributes>
+        <description>
+            If the Router can return a partial list of files in a multi-destination mount point when one of the subclusters is unavailable.
+            True may return a partial list of files if a subcluster is down.
+            False will fail the request if one is unavailable.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.client.mount-status.time-out</name>
+        <value>1s</value>
+        <description>
+            Set a timeout for the Router when listing folders containing mount
+            points. In this process, the Router checks the mount table and then it
+            checks permissions in the subcluster. After the time out, we return the
+            default values.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.connect.max.retries.on.timeouts</name>
+        <value>0</value>
+        <value-attributes>
+            <type>int</type>
+        </value-attributes>
+        <description>
+            Maximum number of retries for the IPC Client when connecting to the
+            subclusters. By default, it doesn't let the IPC retry and the Router
+            handles it.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.connect.timeout</name>
+        <value>2s</value>
+        <description>
+            Time out for the IPC client connecting to the subclusters. This should be
+            short as the Router has knowledge of the state of the Routers.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <!--  <property>
+        <name>dfs.federation.router.keytab.file</name>
+        <value></value>
+        <description>
+          The keytab file used by router to login as its
+          service principal. The principal name is configured with
+          dfs.federation.router.kerberos.principal.
+        </description>
+      </property>
+      <property>
+        <name>dfs.federation.router.kerberos.principal</name>
+        <value></value>
+        <description>
+          The Router service principal. This is typically set to
+          router/_HOST@REALM.TLD. Each Router will substitute _HOST with its
+          own fully qualified hostname at startup. The _HOST placeholder
+          allows using the same configuration setting on both Router
+          in an HA setup.
+        </description>
+      </property>
+      <property>
+        <name>dfs.federation.router.kerberos.principal.hostname</name>
+        <value></value>
+        <description>
+          Optional.  The hostname for the Router containing this
+          configuration file.  Will be different for each machine.
+          Defaults to current hostname.
+        </description>
+      </property>
+      <property>
+        <name>dfs.federation.router.kerberos.internal.spnego.principal</name>
+        <value>${dfs.web.authentication.kerberos.principal}</value>
+        <description>
+          The server principal used by the Router for web UI SPNEGO
+          authentication when Kerberos security is enabled. This is
+          typically set to HTTP/_HOST@REALM.TLD The SPNEGO server principal
+          begins with the prefix HTTP/ by convention.
+          If the value is '*', the web server will attempt to login with
+          every principal specified in the keytab file
+          dfs.web.authentication.kerberos.keytab.
+        </description>
+      </property>
+    -->
+    <property>
+        <name>dfs.federation.router.mount-table.cache.update</name>
+        <value>true</value>
+        <value-attributes>
+            <type>boolean</type>
+        </value-attributes>
+        <description>Set true to enable MountTableRefreshService. This service
+            updates mount table cache immediately after adding, modifying or
+            deleting the mount table entries. If this service is not enabled
+            mount table cache are refreshed periodically by
+            StateStoreCacheUpdateService
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.mount-table.cache.update.timeout</name>
+        <value>1m</value>
+        <description>This property defines how long to wait for all the
+            admin servers to finish their mount table cache update. This setting
+            supports multiple time unit suffixes as described in
+            dfs.federation.router.safemode.extension.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.mount-table.cache.update.client.max.time</name>
+        <value>5m</value>
+        <description>Remote router mount table cache is updated through
+            RouterClient(RPC call). To improve performance, RouterClient
+            connections are cached but it should not be kept in cache forever.
+            This property defines the max time a connection can be cached. This
+            setting supports multiple time unit suffixes as described in
+            dfs.federation.router.safemode.extension.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>dfs.federation.router.secret.manager.class</name>
+        <value>org.apache.hadoop.hdfs.server.federation.router.security.token.ZKDelegationTokenSecretManagerImpl</value>
+        <description>
+            Class to implement state store to delegation tokens.
+            Default implementation uses zookeeper as the backend to store delegation tokens.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+</configuration>
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/kerberos.json b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/kerberos.json
index 271d895461..e11292171f 100644
--- a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/kerberos.json
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/kerberos.json
@@ -161,6 +161,32 @@
             }
           ]
         },
+        {
+          "name": "ROUTER",
+          "identities": [
+            {
+              "name": "dfsrouter_dr",
+              "principal": {
+                "value": "router/_HOST@${realm}",
+                "type" : "service",
+                "configuration": "hdfs-rbf-site/dfs.federation.router.kerberos.principal",
+                "local_username" : "${hadoop-env/hdfs_user}"
+              },
+              "keytab": {
+                "file": "${keytab_dir}/dr.service.keytab",
+                "owner": {
+                  "name": "${hadoop-env/hdfs_user}",
+                  "access": "r"
+                },
+                "group": {
+                  "name": "${cluster-env/user_group}",
+                  "access": ""
+                },
+                "configuration": "hdfs-rbf-site/dfs.federation.router.keytab.file"
+              }
+            }
+          ]
+        },
         {
           "name": "SECONDARY_NAMENODE",
           "identities": [
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/metainfo.xml
index 8656000331..d183da6366 100644
--- a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/metainfo.xml
@@ -223,6 +223,52 @@
           </configFiles>
         </component>
 
+        <component>
+          <name>ROUTER</name>
+          <displayName>Router</displayName>
+          <category>SLAVE</category>
+          <cardinality>0+</cardinality>
+          <versionAdvertised>true</versionAdvertised>
+          <reassignAllowed>true</reassignAllowed>
+          <timelineAppid>router</timelineAppid>
+          <commandScript>
+            <script>scripts/router.py</script>
+            <scriptType>PYTHON</scriptType>
+            <timeout>1800</timeout>
+          </commandScript>
+          <logs>
+            <log>
+              <logId>hdfs_router</logId>
+              <primary>true</primary>
+            </log>
+            <log>
+              <logId>hdfs_audit</logId>
+            </log>
+          </logs>
+          <dependencies>
+            <dependency>
+              <name>HDFS/HDFS_CLIENT</name>
+              <scope>host</scope>
+              <auto-deploy>
+                <enabled>true</enabled>
+              </auto-deploy>
+            </dependency>
+          </dependencies>
+          <configuration-dependencies>
+            <config-type>hdfs-rbf-site</config-type>
+          </configuration-dependencies>
+          <customCommands>
+            <customCommand>
+              <name>DECOMMISSION</name>
+              <commandScript>
+                <script>scripts/router.py</script>
+                <scriptType>PYTHON</scriptType>
+                <timeout>600</timeout>
+              </commandScript>
+            </customCommand>
+          </customCommands>
+        </component>
+
         <component>
           <name>JOURNALNODE</name>
           <displayName>JournalNode</displayName>
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/dfsrouter.py b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/dfsrouter.py
new file mode 100644
index 0000000000..15d04936c9
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/dfsrouter.py
@@ -0,0 +1,143 @@
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+    http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+
+import sys
+import os
+import json
+import tempfile
+import hashlib
+from datetime import datetime
+import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set.
+
+from ambari_commons import constants
+
+from resource_management.libraries.resources.xml_config import XmlConfig
+
+from resource_management.libraries.script.script import Script
+from resource_management.core.resources.system import Execute, File
+from resource_management.core import shell
+from resource_management.libraries.functions import stack_select
+from resource_management.libraries.functions import upgrade_summary
+from resource_management.libraries.functions.constants import Direction
+from resource_management.libraries.functions.format import format
+from resource_management.libraries.resources.execute_hadoop import ExecuteHadoop
+from resource_management.libraries.functions.security_commons import build_expectations, \
+  cached_kinit_executor, get_params_from_filesystem, validate_security_config_properties, \
+  FILE_TYPE_XML
+
+from resource_management.core.exceptions import Fail
+from resource_management.core.shell import as_user
+from resource_management.core.logger import Logger
+
+
+from ambari_commons.os_family_impl import OsFamilyImpl
+from ambari_commons import OSConst
+
+from hdfs_router import router
+
+
+from hdfs import hdfs, reconfig
+import hdfs_rebalance
+from utils import initiate_safe_zkfc_failover, get_hdfs_binary, get_dfsrouteradmin_base_command
+from resource_management.libraries.functions.namenode_ha_utils import get_hdfs_cluster_id_from_jmx
+
+# The hash algorithm to use to generate digests/hashes
+HASH_ALGORITHM = hashlib.sha224
+
+class Router(Script):
+
+  def get_hdfs_binary(self):
+    """
+    Get the name or path to the hdfs binary depending on the component name.
+    """
+    return get_hdfs_binary("hadoop-hdfs-dfsrouter")
+
+  def install(self, env):
+      import params
+      env.set_params(params)
+      self.install_packages(env)
+      self.configure(env)
+
+  def configure(self, env):
+    import params
+    env.set_params(params)
+    hdfs("router")
+    hdfs_binary = self.get_hdfs_binary()
+    router(action="configure", hdfs_binary=hdfs_binary, env=env)
+    XmlConfig("hdfs-site.xml",
+                        conf_dir=params.hadoop_conf_dir,
+                        configurations=params.router_hdfs_site,
+                        configuration_attributes=params.config['configurationAttributes']['hdfs-site'],
+                        mode=0o644,
+                        owner=params.hdfs_user,
+                        group=params.user_group
+              )
+    XmlConfig("core-site.xml",
+                        conf_dir=params.hadoop_conf_dir,
+                        configurations=params.router_core_site,
+                        configuration_attributes=params.config['configurationAttributes']['core-site'],
+                        mode=0o644,
+                        owner=params.hdfs_user,
+                        group=params.user_group
+              )
+
+  def save_configs(self, env):
+    import params
+    env.set_params(params)
+    hdfs()
+
+  def reload_configs(self, env):
+    import params
+    env.set_params(params)
+    Logger.info("RELOAD CONFIGS")
+    reconfig("router", params.router_address)
+
+  def start(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+    self.configure(env)
+    hdfs_binary = self.get_hdfs_binary()
+    router(action="start", hdfs_binary=hdfs_binary, env=env)
+
+  def stop(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+    hdfs_binary = self.get_hdfs_binary()
+    router(action="stop", hdfs_binary=hdfs_binary, env=env)
+
+  def status(self, env):
+    import status_params
+    env.set_params(status_params)
+    router(action="status", env=env)
+
+  def get_log_folder(self):
+    import params
+    return params.hdfs_log_dir
+
+  def get_user(self):
+    import params
+    return params.hdfs_user
+
+  def get_pid_files(self):
+    import status_params
+    return [status_params.router_pid_file]
+
+def _print(line):
+  sys.stdout.write(line)
+  sys.stdout.flush()
+
+if __name__ == "__main__":
+  Router().execute()
\ No newline at end of file
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/hdfs.py b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/hdfs.py
index 31664c9744..93bd8f0c9e 100644
--- a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/hdfs.py
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/hdfs.py
@@ -130,6 +130,15 @@ def hdfs(name=None):
             group=params.user_group
   )
 
+  XmlConfig("hdfs-rbf-site.xml",
+              conf_dir=params.hadoop_conf_dir,
+              configurations=params.config['configurations']['hdfs-rbf-site'],
+              configuration_attributes=params.config['configurationAttributes']['hdfs-rbf-site'],
+              mode=0o644,
+              owner=params.hdfs_user,
+              group=params.user_group
+    )
+
   XmlConfig("core-site.xml",
             conf_dir=params.hadoop_conf_dir,
             configurations=params.config['configurations']['core-site'],
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/hdfs_router.py b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/hdfs_router.py
new file mode 100644
index 0000000000..a4064925a2
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/hdfs_router.py
@@ -0,0 +1,91 @@
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+    http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+import os.path
+import time
+
+from ambari_commons import constants
+
+from resource_management.core import shell
+from resource_management.core.source import Template
+from resource_management.core.resources.system import File, Execute, Directory
+from resource_management.core.resources.service import Service
+from resource_management.libraries.functions.decorator import retry
+from resource_management.libraries.functions.default import default
+from resource_management.libraries.functions.format import format
+from resource_management.libraries.functions.check_process_status import check_process_status
+from resource_management.libraries.resources.execute_hadoop import ExecuteHadoop
+from resource_management.libraries.functions import Direction, upgrade_summary
+from resource_management.libraries.functions.namenode_ha_utils import get_name_service_by_hostname
+from resource_management.libraries.functions.generate_logfeeder_input_config import generate_logfeeder_input_config
+from ambari_commons import OSCheck, OSConst
+from ambari_commons.os_family_impl import OsFamilyImpl, OsFamilyFuncImpl
+from utils import get_dfsrouteradmin_base_command
+from utils import set_up_zkfc_security
+
+if OSCheck.is_windows_family():
+  from resource_management.libraries.functions.windows_service_utils import check_windows_service_status
+
+from resource_management.core.exceptions import Fail
+from resource_management.core.logger import Logger
+
+from utils import service, safe_zkfc_op, is_previous_fs_image
+from setup_ranger_hdfs import setup_ranger_hdfs, create_ranger_audit_hdfs_directories
+
+
+@OsFamilyFuncImpl(os_family=OsFamilyImpl.DEFAULT)
+def router(action=None, hdfs_binary=None, env=None):
+
+  if action is None:
+    raise Fail('"action" parameter is required for function router().')
+
+  if action in ["start", "stop"] and hdfs_binary is None:
+    raise Fail('"hdfs_binary" parameter is required for function router().')
+
+  if action == "configure":
+    import params
+    generate_logfeeder_input_config('hdfs', Template("input.config-hdfs.json.j2", extra_imports=[default]))
+    # set up failover /  secure zookeper ACLs, this feature is supported from VDP 2.6 ownwards
+    set_up_zkfc_security(params)
+  elif action == "start":
+    import params
+    service(
+      action="start",
+      name="dfsrouter",
+      user=params.hdfs_user,
+      create_pid_dir=True,
+      create_log_dir=True
+    )
+
+    if params.security_enabled:
+      Execute(format("{kinit_path_local} -kt {hdfs_user_keytab} {hdfs_principal_name}"),
+              user = params.hdfs_user)
+
+    name_service = get_name_service_by_hostname(params.hdfs_site, params.hostname)
+    ensure_safemode_off = True
+
+  elif action == "stop":
+    import params
+    service(
+      action="stop", name="dfsrouter",
+      user=params.hdfs_user
+    )
+  elif action == "status":
+    import status_params
+    check_process_status(status_params.router_pid_file)
+
+
+
+
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/params_linux.py b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/params_linux.py
index d4618067f7..cf5072fdc7 100644
--- a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/params_linux.py
@@ -220,6 +220,7 @@ hbase_master_hosts = default("/clusterHostInfo/hbase_master_hosts", [])
 hs_host = default("/clusterHostInfo/historyserver_hosts", [])
 jtnode_host = default("/clusterHostInfo/jtnode_hosts", [])
 namenode_host = default("/clusterHostInfo/namenode_hosts", [])
+router_host = default("/clusterHostInfo/router_hosts", [])
 nm_host = default("/clusterHostInfo/nodemanager_hosts", [])
 ganglia_server_hosts = default("/clusterHostInfo/ganglia_server_hosts", [])
 journalnode_hosts = default("/clusterHostInfo/journalnode_hosts", [])
@@ -320,6 +321,38 @@ dfs_data_dirs_perm = int(dfs_data_dirs_perm, base=8) # convert int from octal re
 
 data_dir_mount_file = "/var/lib/ambari-agent/data/datanode/dfs_data_dir_mount.hist"
 
+router_address = None
+if 'dfs.federation.router.rpc-address' in config['configurations']['hdfs-rbf-site']:
+  router_rpcaddress = config['configurations']['hdfs-rbf-site']['dfs.federation.router.rpc-address']
+  router_address = format("hdfs://{router_rpcaddress}")
+else:
+  router_address = config['configurations']['core-site']['fs.defaultFS']
+if router_host:
+  router_hdfs_site = dict(config['configurations']['hdfs-site'])
+  router_core_site = dict(config['configurations']['core-site'])
+  nameservices = config['configurations']['hdfs-site'].get('dfs.nameservices')
+  if not isinstance(nameservices, str):
+    # handle the error, for example by raising an exception or setting a default value
+     print("The dfs.nameservices property is not set or not a string")
+     nameservices = ''
+
+  router_hdfs_site['dfs.nameservices'] = nameservices + ",ns-fed"
+  router_hdfs_site['dfs.client.failover.proxy.provider.ns-fed'] = 'org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider'
+  router_hdfs_site['dfs.client.failover.random.order'] = 'true'
+  router_id_list = ["r" + str(i) for i in range(1, len(router_host) + 1)]
+  router_ids = ",".join(router_id_list)
+  router_hdfs_site['dfs.ha.namenodes.ns-fed'] = router_ids
+  for i, curr_router_host in enumerate(router_host):
+      id = router_id_list[i]
+      prop_name = "dfs.namenode.rpc-address.ns-fed." + id
+      prop_value = curr_router_host + ":" + "20010"
+      router_hdfs_site[prop_name] = prop_value
+
+  router_core_site['fs.defaultFS'] = "hdfs://ns-fed"
+  router_core_site['hadoop.zk.address'] = config['configurations']['core-site'].get('ha.zookeeper.quorum')
+else:
+    print("No router hosts found")
+
 # HDFS High Availability properties
 dfs_ha_enabled = False
 dfs_ha_nameservices = default('/configurations/hdfs-site/dfs.internal.nameservices', None)
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/utils.py b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/utils.py
index 5ce8598bf5..9bebc21663 100644
--- a/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/utils.py
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/utils.py
@@ -403,6 +403,22 @@ def get_dfsadmin_base_command(hdfs_binary, use_specific_namenode = False):
     dfsadmin_base_command = format("{hdfs_binary} dfsadmin -fs {params.namenode_address}")
   return dfsadmin_base_command
 
+def get_dfsrouteradmin_base_command(hdfs_binary, use_specific_router = False):
+  """
+  Get the dfsrouteradmin base command constructed using hdfs_binary path and passing router address as explicit -fs argument
+  :param hdfs_binary: path to hdfs binary to use
+  :param use_specific_router: flag if set and Router HA is enabled, then the dfsrouteradmin command will use
+  current router's address
+  :return: the constructed dfsrouteradmin base command
+  """
+  import params
+  dfsrouteradmin_base_command = ""
+  if params.dfs_ha_enabled and use_specific_router:
+    dfsrouteradmin_base_command = format("{hdfs_binary} dfsrouteradmin -fs hdfs://{params.router_rpc}")
+  else:
+    dfsadmin_base_command = format("{hdfs_binary} dfsrouteradmin -fs {params.router_address}")
+  return dfsrouteradmin_base_command
+
 
 def set_up_zkfc_security(params):
     """ Sets up security for accessing zookeper on secure clusters """
diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js
index bd858a51b0..fbfa68d05c 100644
--- a/ambari-web/app/controllers.js
+++ b/ambari-web/app/controllers.js
@@ -61,6 +61,11 @@ require('controllers/main/admin/federation/step1_controller');
 require('controllers/main/admin/federation/step2_controller');
 require('controllers/main/admin/federation/step3_controller');
 require('controllers/main/admin/federation/step4_controller');
+require('controllers/main/admin/federation/routerBasedFederation/wizard_controller');
+require('controllers/main/admin/federation/routerBasedFederation/step1_controller');
+require('controllers/main/admin/federation/routerBasedFederation/step2_controller');
+require('controllers/main/admin/federation/routerBasedFederation/step3_controller');
+require('controllers/main/admin/federation/routerBasedFederation/step4_controller');
 require('controllers/main/admin/highAvailability/hawq/addStandby/wizard_controller');
 require('controllers/main/admin/highAvailability/hawq/addStandby/step1_controller');
 require('controllers/main/admin/highAvailability/hawq/addStandby/step2_controller');
diff --git a/ambari-web/app/controllers/main/admin/federation/routerBasedFederation/step1_controller.js b/ambari-web/app/controllers/main/admin/federation/routerBasedFederation/step1_controller.js
new file mode 100644
index 0000000000..60ee0bb268
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/federation/routerBasedFederation/step1_controller.js
@@ -0,0 +1,26 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+App.RouterFederationWizardStep1Controller = Em.Controller.extend({
+    name: "routerFederationWizardStep1Controller",
+    next: function () {
+        App.router.send('next');
+    }
+});
\ No newline at end of file
diff --git a/ambari-web/app/controllers/main/admin/federation/routerBasedFederation/step2_controller.js b/ambari-web/app/controllers/main/admin/federation/routerBasedFederation/step2_controller.js
new file mode 100644
index 0000000000..a367c3d2b2
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/federation/routerBasedFederation/step2_controller.js
@@ -0,0 +1,67 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+App.RouterFederationWizardStep2Controller = Em.Controller.extend(App.AssignMasterComponents, {
+
+    name: "routerFederationWizardStep2Controller",
+
+    useServerValidation: false,
+
+    mastersToShow: ['NAMENODE', 'ROUTER'],
+
+    mastersToAdd: ['ROUTER'],
+
+    showCurrentPrefix: ['NAMENODE', 'ROUTER'],
+
+    showAdditionalPrefix: ['ROUTER'],
+
+    mastersAddableInHA: ['ROUTER'],
+
+    showInstalledMastersFirst: true,
+
+    renderComponents: function (masterComponents) {
+        // check if we are restoring components assignment by checking existence of ROUTER component in array
+        var restoringComponents = masterComponents.someProperty('component_name', 'ROUTER');
+        masterComponents = restoringComponents ? masterComponents : masterComponents.concat(this.generateRouterComponents());
+        this._super(masterComponents);
+        // if you have similar functions for router, call them here
+    },
+
+
+    generateRouterComponents: function () {
+        var router = [];
+        App.HostComponent.find().filterProperty('componentName', 'ROUTER').forEach(function (rbf) {
+            var rbfComponent = this.createComponentInstallationObject(Em.Object.create({
+                serviceName: rbf.get('service.serviceName'),
+                componentName: rbf.get('componentName')
+            }), rbf.get('hostName'));
+            rbfComponent.isInstalled = true;
+            router.push(rbfComponent);
+        }, this);
+        return router;
+    },
+
+    actions: {
+        back() {
+            this.clearStep()
+        }
+    }
+
+});
diff --git a/ambari-web/app/controllers/main/admin/federation/routerBasedFederation/step3_controller.js b/ambari-web/app/controllers/main/admin/federation/routerBasedFederation/step3_controller.js
new file mode 100644
index 0000000000..364f125b1c
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/federation/routerBasedFederation/step3_controller.js
@@ -0,0 +1,191 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+App.RouterFederationWizardStep3Controller = Em.Controller.extend(App.BlueprintMixin, {
+    name: "routerFederationWizardStep3Controller",
+    selectedService: null,
+    stepConfigs: [],
+    serverConfigData: {},
+    once: false,
+    isLoaded: false,
+    isConfigsLoaded: false,
+    versionLoaded: true,
+    hideDependenciesInfoBar: true,
+
+    /**
+     * Map of sites and properties to delete
+     * @type Object
+     */
+
+    clearStep: function () {
+        this.get('stepConfigs').clear();
+        this.set('serverConfigData', {});
+        this.set('isConfigsLoaded', false);
+        this.set('isLoaded', false);
+    },
+
+    loadStep: function () {
+        this.clearStep();
+        this.loadConfigsTags();
+    },
+
+    loadConfigsTags: function () {
+        return App.ajax.send({
+            name: 'config.tags',
+            sender: this,
+            success: 'onLoadConfigsTags'
+        });
+    },
+
+
+    onLoadConfigsTags: function (data) {
+        var urlParams = '(type=hdfs-rbf-site&tag=' + data.Clusters.desired_configs['hdfs-rbf-site'].tag + ')|';
+        urlParams += '(type=hdfs-site&tag=' + data.Clusters.desired_configs['hdfs-site'].tag + ')|';
+        urlParams += '(type=core-site&tag=' + data.Clusters.desired_configs['core-site'].tag + ')';
+        App.ajax.send({
+            name: 'admin.get.all_configurations',
+            sender: this,
+            data: {
+                urlParams: urlParams
+            },
+            success: 'onLoadConfigs'
+        });
+    },
+
+    onLoadConfigs: function (data) {
+        this.set('serverConfigData', data);
+        this.set('isConfigsLoaded', true);
+    },
+
+    onLoad: function () {
+        if (this.get('isConfigsLoaded') && App.router.get('clusterController.isHDFSNameSpacesLoaded')) {
+            var routerFederationConfig = $.extend(true, {}, require('data/configs/wizards/router_federation_properties').routerFederationConfig);
+            if (App.get('hasNameNodeFederation')) {
+                routerFederationConfig.configs = routerFederationConfig.configs.rejectProperty('firstRun');
+            }
+            routerFederationConfig.configs = this.tweakServiceConfigs(routerFederationConfig.configs);
+            var configsFromServer = this.get('serverConfigData.items');
+            var hdfsrbfConfigs = configsFromServer.findProperty('type', 'hdfs-rbf-site');
+            var configToSave = {
+                type: 'hdfs-rbf-site',
+                properties: hdfsrbfConfigs&&hdfsrbfConfigs.properties,
+            };
+            if (hdfsrbfConfigs && hdfsrbfConfigs.properties_attributes) {
+                configToSave.properties_attributes = hdfsrbfConfigs.properties_attributes;
+            }
+            for(const property of routerFederationConfig.configs){
+                configToSave.properties[property.name]=property.value
+            }
+            App.ajax.send({
+                name: 'common.service.configurations',
+                sender: self,
+                data: {
+                    desired_config: configToSave
+                },
+                error: 'onTaskError'
+            });
+
+            this.renderServiceConfigs(routerFederationConfig);
+            this.set('isLoaded', true);
+        }
+    }.observes('isConfigsLoaded', 'App.router.clusterController.isHDFSNameSpacesLoaded'),
+
+    prepareDependencies: function () {
+        var ret = {};
+        var configsFromServer = this.get('serverConfigData.items');
+        var nameNodes = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE');
+        var hdfsSiteConfigs = configsFromServer.findProperty('type', 'hdfs-site').properties;
+        var coreSiteConfigs = configsFromServer.findProperty('type', 'core-site').properties;
+        var nameServices = App.HDFSService.find().objectAt(0).get('masterComponentGroups').mapProperty('name');
+        var modifiedNameServices = [];
+        var nnCounter = 1;
+        ret.nameServicesList = nameServices.join(',');
+        ret.nameservice1 = nameServices[0];
+        for (let i = 0; i < nameServices.length; i++) {
+            let nameservice = nameServices[i];
+            modifiedNameServices.push(`${nameservice}.nn${nnCounter}`);
+            nnCounter++;
+            modifiedNameServices.push(`${nameservice}.nn${nnCounter}`);
+            nnCounter++;
+        }
+        ret.modifiedNameServices = modifiedNameServices.join(',');
+
+        ret.zkAddress = coreSiteConfigs['ha.zookeeper.quorum'];
+
+        return ret;
+    },
+    tweakServiceConfigs: function (configs) {
+        var dependencies = this.prepareDependencies();
+        var result = [];
+        var configsToRemove = [];
+        var hdfsSiteConfigs = this.get('serverConfigData').items.findProperty('type', 'hdfs-site').properties;
+        var wizardController = App.router.get(this.get('content.controllerName'));
+        configs.forEach(function (config) {
+            config.isOverridable = false;
+            config.name = wizardController.replaceDependencies(config.name, dependencies);
+            config.displayName = wizardController.replaceDependencies(config.displayName, dependencies);
+            config.value = wizardController.replaceDependencies(config.value, dependencies);
+            config.recommendedValue = wizardController.replaceDependencies(config.recommendedValue, dependencies);
+            result.push(config);
+
+        }, this);
+
+        return result;
+    },
+
+    renderServiceConfigs: function (_serviceConfig) {
+        var serviceConfig = App.ServiceConfig.create({
+            serviceName: _serviceConfig.serviceName,
+            displayName: _serviceConfig.displayName,
+            configCategories: [],
+            showConfig: true,
+            configs: []
+        });
+
+        _serviceConfig.configCategories.forEach(function (_configCategory) {
+            if (App.Service.find().someProperty('serviceName', _configCategory.name)) {
+                serviceConfig.configCategories.pushObject(_configCategory);
+            }
+        }, this);
+
+        this.loadComponentConfigs(_serviceConfig, serviceConfig);
+
+        this.get('stepConfigs').pushObject(serviceConfig);
+        this.set('selectedService', this.get('stepConfigs').objectAt(0));
+        this.set('once', true);
+    },
+
+    /**
+     * Load child components to service config object
+     * @param _componentConfig
+     * @param componentConfig
+     */
+    loadComponentConfigs: function (_componentConfig, componentConfig) {
+        _componentConfig.configs.forEach(function (_serviceConfigProperty) {
+            var serviceConfigProperty = App.ServiceConfigProperty.create(_serviceConfigProperty);
+            componentConfig.configs.pushObject(serviceConfigProperty);
+            serviceConfigProperty.set('isEditable', serviceConfigProperty.get('isReconfigurable'));
+        }, this);
+    },
+
+    isNextDisabled: function () {
+        return !this.get('isLoaded') || (this.get('isLoaded') && this.get('selectedService.configs').someProperty('isValid', false));
+    }.property('selectedService.configs.@each.isValid', 'isLoaded')
+});
\ No newline at end of file
diff --git a/ambari-web/app/controllers/main/admin/federation/routerBasedFederation/step4_controller.js b/ambari-web/app/controllers/main/admin/federation/routerBasedFederation/step4_controller.js
new file mode 100644
index 0000000000..8e0f5925f2
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/federation/routerBasedFederation/step4_controller.js
@@ -0,0 +1,80 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+App.RouterFederationWizardStep4Controller = App.HighAvailabilityProgressPageController.extend(App.WizardEnableDone, {
+
+    name: "routerFederationWizardStep4Controller",
+
+    commands: ['installRouter', 'startRouters'],
+
+    tasksMessagesPrefix: 'admin.routerFederation.wizard.step',
+
+    initializeTasks: function () {
+        this._super();
+        this.removeUnneededTasks();
+    },
+
+    removeUnneededTasks: function () {
+        var installedServices = App.Service.find().mapProperty('serviceName');
+        if (!installedServices.contains('RANGER')) {
+            this.removeTasks(['startInfraSolr', 'startRangerAdmin', 'startRangerUsersync']);
+        }
+        if (!installedServices.contains('AMBARI_INFRA_SOLR')) {
+            this.removeTasks(['startInfraSolr']);
+        }
+    },
+
+    reconfigureServices: function () {
+        var servicesModel = App.Service.find();
+        var configs = [];
+        var data = this.get('content.serviceConfigProperties');
+        var note = Em.I18n.t('admin.routerFederation.wizard,step4.save.configuration.note');
+        configs.push({
+            Clusters: {
+                desired_config: this.reconfigureSites(['hdfs-rbf-site'], data, note)
+            }
+        });
+        return App.ajax.send({
+            name: 'common.service.multiConfigurations',
+            sender: this,
+            data: {
+                configs: configs
+            },
+            error: 'onTaskError',
+            success: 'installHDFSClients'
+        });
+    },
+
+    installHDFSClients: function () {
+        var nnHostNames = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').mapProperty('hostName');
+        var jnHostNames = App.HostComponent.find().filterProperty('componentName', 'JOURNALNODE').mapProperty('hostName');
+        var hostNames = nnHostNames.concat(jnHostNames).uniq();
+        this.createInstallComponentTask('HDFS_CLIENT', hostNames, 'HDFS');
+    },
+
+    installRouter: function () {
+        this.createInstallComponentTask('ROUTER', this.get('content.masterComponentHosts').filterProperty('component', 'ROUTER').mapProperty('hostName'), "HDFS");
+    },
+
+    startRouters: function () {
+        var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'ROUTER').mapProperty('hostName');
+        this.updateComponent('ROUTER', hostNames, "HDFS", "Start");
+    }
+});
\ No newline at end of file
diff --git a/ambari-web/app/controllers/main/admin/federation/routerBasedFederation/wizard_controller.js b/ambari-web/app/controllers/main/admin/federation/routerBasedFederation/wizard_controller.js
new file mode 100644
index 0000000000..588030821d
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/federation/routerBasedFederation/wizard_controller.js
@@ -0,0 +1,158 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+var App = require('app');
+
+App.RouterFederationWizardController = App.WizardController.extend({
+
+    name: 'routerFederationWizardController',
+
+    totalSteps: 4,
+
+    /**
+     * @type {string}
+     */
+    displayName: Em.I18n.t('admin.routerFederation.wizard.header'),
+
+    isFinished: false,
+
+    content: Em.Object.create({
+        controllerName: 'routerFederationWizardController'
+    }),
+
+    /**
+     * Load data for all steps until <code>current step</code>
+     */
+    loadMap: {
+        '1': [
+            {
+                type: 'sync',
+                callback: function () {
+                    this.load('cluster');
+                }
+            }
+        ],
+        '2': [
+            {
+                type: 'async',
+                callback: function () {
+                    var self = this,
+                        dfd = $.Deferred();
+                    this.loadServicesFromServer();
+                    this.loadMasterComponentHosts().done(function () {
+                        self.loadConfirmedHosts();
+                        dfd.resolve();
+                    });
+                    return dfd.promise();
+                }
+            }
+        ],
+        '3': [
+            {
+                type: 'sync',
+                callback: function () {
+                    this.load('cluster');
+                }
+            }
+        ],
+        '4': [
+            {
+                type: 'sync',
+                callback: function () {
+                    this.loadServiceConfigProperties();
+                    this.loadTasksStatuses();
+                    this.loadTasksRequestIds();
+                    this.loadRequestIds();
+                }
+            }
+        ]
+    },
+
+    init: function () {
+        this._super();
+        this.clearStep();
+    },
+
+    clearStep: function () {
+        this.set('isFinished', false);
+    },
+
+    setCurrentStep: function (currentStep, completed) {
+        this._super(currentStep, completed);
+        App.clusterStatus.setClusterStatus({
+            clusterName: this.get('content.cluster.name'),
+            wizardControllerName: 'routerFederationWizardController',
+            localdb: App.db.data
+        });
+    },
+
+    saveNNHosts: function (nnHosts) {
+        this.set('content.nnHosts', nnHosts);
+        this.setDBProperty('nnHosts', nnHosts);
+    },
+
+    /**
+     * Load hosts for additional and current ResourceManagers from local db to <code>controller.content</code>
+     */
+    loadNNHosts: function() {
+        var nnHosts = this.getDBProperty('nnHosts');
+        this.set('content.nnHosts', nnHosts);
+    },
+
+    saveServiceConfigProperties: function (stepController) {
+        var serviceConfigProperties = [];
+        var data = stepController.get('serverConfigData');
+
+        var _content = stepController.get('stepConfigs')[0];
+        _content.get('configs').forEach(function (_configProperties) {
+            var siteObj = data.items.findProperty('type', _configProperties.get('filename'));
+            if (siteObj) {
+                siteObj.properties[_configProperties.get('name')] = _configProperties.get('value');
+            }
+        }, this);
+        this.setDBProperty('serviceConfigProperties', data);
+        this.set('content.serviceConfigProperties', data);
+    },
+
+    /**
+     * Load serviceConfigProperties to model
+     */
+    loadServiceConfigProperties: function () {
+        this.set('content.serviceConfigProperties', this.getDBProperty('serviceConfigProperties'));
+    },
+
+    /**
+     * Remove all loaded data.
+     * Created as copy for App.router.clearAllSteps
+     */
+    clearAllSteps: function () {
+        this.clearInstallOptions();
+        // clear temporary information stored during the install
+        this.set('content.cluster', this.getCluster());
+    },
+
+    /**
+     * Clear all temporary data
+     */
+    finish: function () {
+        this.resetDbNamespace();
+        App.router.get('updateController').updateAll();
+        this.set('isFinished', true);
+    }
+});
\ No newline at end of file
diff --git a/ambari-web/app/controllers/main/admin/highAvailability_controller.js b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
index 3ac7214979..f73f895ec7 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability_controller.js
@@ -142,6 +142,28 @@ App.MainAdminHighAvailabilityController = App.WizardController.extend({
     return true;
   },
 
+  /**
+   * enable router Based Federation
+   * @return {Boolean}
+   */
+  enableRouterFederation: function () {
+    //Prerequisite Checks
+    var message = [];
+    if (!App.HostComponent.find().filterProperty('componentName', 'ZOOKEEPER_SERVER').everyProperty('workStatus', 'STARTED')) {
+      message.push(Em.I18n.t('admin.nameNodeFederation.wizard.required.zookeepers'));
+    }
+
+    if (!App.HostComponent.find().filterProperty('componentName', 'JOURNALNODE').everyProperty('workStatus', 'STARTED')) {
+      message.push(Em.I18n.t('admin.nameNodeFederation.wizard.required.journalnodes'));
+    }
+    if (message.length > 0) {
+      this.showErrorPopup(message);
+      return false;
+    }
+    App.router.transitionTo('main.services.enableRouterFederation');
+    return true;
+  },
+
   /**
    * open Manage JournalNode Wizard if there are two started NameNodes with defined active/standby state
    * @returns {boolean}
diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js
index d749c313f7..380c94aaab 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -1518,6 +1518,11 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
     highAvailabilityController.enableNameNodeFederation();
   },
 
+  openRouterFederationWizard: function () {
+    var highAvailabilityController = App.router.get('mainAdminHighAvailabilityController');
+    highAvailabilityController.enableRouterFederation();
+  },
+
   /**
    * This method is called when user event to download configs for "All Clients"
    * is made from service action menu
diff --git a/ambari-web/app/data/configs/wizards/router_federation_properties.js b/ambari-web/app/data/configs/wizards/router_federation_properties.js
new file mode 100644
index 0000000000..c87f2eb4d4
--- /dev/null
+++ b/ambari-web/app/data/configs/wizards/router_federation_properties.js
@@ -0,0 +1,80 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+module.exports =
+    {
+        "routerFederationConfig": {
+            serviceName: 'MISC',
+            displayName: 'MISC',
+            configCategories: [
+                App.ServiceConfigCategory.create({ name: 'HDFS', displayName: 'HDFS'})
+            ],
+            sites: ['core-site', 'hdfs-rbf-site'],
+            configs: [
+                {
+                    "name": "dfs.federation.router.monitor.namenode",
+                    "displayName": "dfs.federation.router.monitor.namenode",
+                    "description": "RPC address for HDFS Services communication.",
+                    "isReconfigurable": false,
+                    "recommendedValue": "{{nameservice1}}.nn1, {{nameservice1}}.nn2, {{newNameservice}}.{{newNameNode1Index}},{{newNameservice}}.{{newNameNode2Index}}",
+                    "value": "{{modifiedNameServices}}",
+                    "category": "HDFS",
+                    "filename": "hdfs-rbf-site",
+                    "serviceName": 'MISC',
+                    "isRouterConfigs" : true
+                },
+                {
+                    "name": "dfs.federation.router.default.nameserviceId",
+                    "displayName": "dfs.federation.router.default.nameserviceId",
+                    "description": "Nameservice identifier of the default subcluster to monitor.",
+                    "isReconfigurable": false,
+                    "recommendedValue": "{{nameservice1}}",
+                    "value": "{{nameservice1}}",
+                    "category": "HDFS",
+                    "filename": "hdfs-rbf-site",
+                    "serviceName": 'MISC',
+                    "isRouterConfigs" : true
+                },
+                {
+                    "name": "zk-dt-secret-manager.zkAuthType",
+                    "displayName": "zk-dt-secret-manager.zkAuthType",
+                    "description": "Secret Manager Zookeeper Authentication Type",
+                    "isReconfigurable": false,
+                    "recommendedValue": "none",
+                    "value": "none",
+                    "category": "HDFS",
+                    "filename": "hdfs-rbf-site",
+                    "serviceName": 'MISC',
+                    "isRouterConfigs" : true
+                },
+                {
+                    "name": "zk-dt-secret-manager.zkConnectionString",
+                    "displayName": "zk-dt-secret-manager.zkConnectionString",
+                    "description": "Secret Manager Zookeeper Connection String",
+                    "isReconfigurable": false,
+                    "recommendedValue": "zk1.example.com:2181,zk2.example.com:2181,zk3.example.com:2181",
+                    "value": "{{zkAddress}}",
+                    "category": "HDFS",
+                    "filename": "hdfs-rbf-site",
+                    "serviceName": 'MISC',
+                    "isRouterConfigs" : true
+                }
+            ]
+        }
+
+    };
\ No newline at end of file
diff --git a/ambari-web/app/data/controller_route.js b/ambari-web/app/data/controller_route.js
index 8f6f385bff..914ee88f15 100644
--- a/ambari-web/app/data/controller_route.js
+++ b/ambari-web/app/data/controller_route.js
@@ -85,6 +85,10 @@ module.exports = [
     wizardControllerName: App.router.get('nameNodeFederationWizardController.name'),
     route: 'main.services.enableNameNodeFederation'
   },
+  {
+    wizardControllerName: App.router.get('routerFederationWizardController.name'),
+    route: 'main.services.enableRouterFederation'
+  },
   {
     wizardControllerName: App.router.get('manageJournalNodeWizardController.name'),
     route: 'main.services.manageJournalNode'
diff --git a/ambari-web/app/locales/default_messages.js b/ambari-web/app/locales/default_messages.js
index b1d7b03cd0..301a04ed8d 100644
--- a/ambari-web/app/locales/default_messages.js
+++ b/ambari-web/app/locales/default_messages.js
@@ -1727,6 +1727,28 @@ var messages_ambari = {
   'admin.nameNodeFederation.wizard.step4.task16.title': 'Start NameNode',
   'admin.nameNodeFederation.wizard.step4.task17.title': 'Restart Required Services',
 
+  'admin.routerFederation.button.enable':'Add DFSRouter',
+  'admin.routerFederation.wizard.header': 'Add HDFS Router',
+  'admin.routerFederation.closePopup': 'Are you sure you want to quit?',
+  'admin.routerFederation.closePopup2': 'Add HDFS Router Wizard is in progress. Are you sure you want to exit the wizard?',
+  'admin.routerFederation.wizard.step1.header': 'Get Started',
+  'admin.routerFederation.wizard.step1.body':'This wizard will walk you through the process of enabling DFSRouter to manage federated cluster.',
+  'admin.routerFederation.wizard.step2.header': 'Select Hosts',
+  'admin.routerFederation.wizard.step2.body': 'Select hosts running the Routers for {0}',
+  'admin.routerFederation.wizard.step3.header': 'Review',
+  'admin.routerFederation.wizard.step3.addRouter': '<b>Add Router:</b> ',
+  'admin.routerFederation.wizard.step3.toBeInstalled': 'Router TO BE INSTALLED',
+  'admin.routerFederation.wizard.step3.confirm.config.body': '<div class="alert alert-info">' +
+      '<p><b>Review Configuration Changes.</b></p>' +
+      'The following lists the configuration changes that will be made by the Wizard to enable Router. This information is for <b> review only </b> and is not editable' +
+      '</div>',
+  'admin.routerFederation.wizard.step4.header': 'Configure Router',
+  'admin.routerFederation.wizard,step4.save.configuration.note':'This configuration is created by Enable DFSRouter wizard',
+  'admin.routerFederation.wizard.step4.notice.inProgress':'Please wait while your Router is being deployed.',
+  'admin.routerFederation.wizard.step4.notice.completed':'Add DFSRouter Wizard has been completed successfully.',
+  'admin.routerFederation.wizard.step4.task0.title': 'Install Routers',
+  'admin.routerFederation.wizard.step4.task1.title': 'Start Routers',
+
   'admin.security.title':'Kerberos security has not been enabled',
   'admin.security.enabled': 'Kerberos security is enabled',
   'admin.security.disabled': 'Kerberos security is disabled',
diff --git a/ambari-web/app/mixins/wizard/assign_master_components.js b/ambari-web/app/mixins/wizard/assign_master_components.js
index 25bf86c38b..53b566212e 100644
--- a/ambari-web/app/mixins/wizard/assign_master_components.js
+++ b/ambari-web/app/mixins/wizard/assign_master_components.js
@@ -1120,6 +1120,9 @@ App.AssignMasterComponents = Em.Mixin.create(App.HostComponentValidationMixin, A
       }
 
       newMaster.set("selectedHost", suggestedHost);
+      if(!currentMasters.get("lastObject.serviceComponentId")){
+        currentMasters.get("lastObject").set("serviceComponentId",0)
+      }
       newMaster.set("serviceComponentId", (currentMasters.get("lastObject.serviceComponentId") + 1));
 
       this.get("selectedServicesMasters").insertAt(this.get("selectedServicesMasters").indexOf(lastMaster) + 1, newMaster);
diff --git a/ambari-web/app/models/host_component.js b/ambari-web/app/models/host_component.js
index 428bca3a16..c404e5691b 100644
--- a/ambari-web/app/models/host_component.js
+++ b/ambari-web/app/models/host_component.js
@@ -575,6 +575,12 @@ App.HostComponentActionMap = {
         cssClass: 'icon icon-sitemap',
         disabled: !App.get('isHaEnabled') || App.get('allHostNames.length') < 4
       },
+      TOGGLE_RBF_FEDERATION: {
+        action: 'openRouterFederationWizard',
+        label: Em.I18n.t('admin.routerFederation.button.enable'),
+        cssClass: 'icon icon-sitemap',
+        disabled: !App.get('hasNameNodeFederation')
+      },
       UPDATE_REPLICATION: {
         action: 'updateHBaseReplication',
         customCommand: 'UPDATE_REPLICATION',
diff --git a/ambari-web/app/models/service.js b/ambari-web/app/models/service.js
index 06d108297e..a1bb73ba37 100644
--- a/ambari-web/app/models/service.js
+++ b/ambari-web/app/models/service.js
@@ -117,7 +117,7 @@ App.Service = DS.Model.extend({
   serviceTypes: function() {
     var typeServiceMap = {
       GANGLIA: ['MONITORING'],
-      HDFS: ['HA_MODE', 'FEDERATION'],
+      HDFS: ['HA_MODE', 'FEDERATION', 'DFSRouter'],
       YARN: ['HA_MODE'],
       RANGER: ['HA_MODE'],
       HAWQ: ['HA_MODE']
diff --git a/ambari-web/app/routes/dfsrouter_federation_routes.js b/ambari-web/app/routes/dfsrouter_federation_routes.js
new file mode 100644
index 0000000000..bc7f8388e9
--- /dev/null
+++ b/ambari-web/app/routes/dfsrouter_federation_routes.js
@@ -0,0 +1,166 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+module.exports = App.WizardRoute.extend({
+    route: '/NameNode/federation/routerBasedFederation',
+
+    breadcrumbs: {
+        label: Em.I18n.t('admin.routerFederation.wizard.header')
+    },
+
+    enter: function (router, transition) {
+        var routerFederationWizardController = router.get('routerFederationWizardController');
+        routerFederationWizardController.dataLoading().done(function () {
+            //Set HDFS as current service
+            App.router.set('mainServiceItemController.content', App.Service.find().findProperty('serviceName', 'HDFS'));
+            App.router.get('updateController').set('isWorking', false);
+            var popup = App.ModalPopup.show({
+                classNames: ['wizard-modal-wrapper'],
+                modalDialogClasses: ['modal-xlg'],
+                header: Em.I18n.t('admin.routerFederation.wizard.header'),
+                bodyClass: App.RouterFederationWizardView.extend({
+                    controller: routerFederationWizardController
+                }),
+                primary: Em.I18n.t('form.cancel'),
+                showFooter: false,
+                secondary: null,
+
+                onClose: function () {
+                    var routerFederationWizardController = router.get('routerFederationWizardController'),
+                        currStep = routerFederationWizardController.get('currentStep');
+                    App.showConfirmationPopup(function () {
+                        routerFederationWizardController.resetOnClose(routerFederationWizardController, 'main.services.index');
+                    }, Em.I18n.t(parseInt(currStep) === 4 ? 'admin.routerFederation.closePopup2' : 'admin.routerFederation.closePopup'));
+                },
+                didInsertElement: function () {
+                    this._super();
+                    this.fitHeight();
+                }
+            });
+            routerFederationWizardController.set('popup', popup);
+            var currentClusterStatus = App.clusterStatus.get('value');
+            if (currentClusterStatus) {
+                switch (currentClusterStatus.clusterState) {
+                    case 'RBF_FEDERATION_DEPLOY' :
+                        routerFederationWizardController.setCurrentStep(currentClusterStatus.localdb.RouterFederationWizard.currentStep);
+                        break;
+                    default:
+                        var currStep = App.router.get('routerFederationWizardController.currentStep');
+                        routerFederationWizardController.setCurrentStep(currStep);
+                        break;
+                }
+            }
+            Em.run.next(function () {
+                App.router.get('wizardWatcherController').setUser(routerFederationWizardController.get('name'));
+                router.transitionTo('step' + routerFederationWizardController.get('currentStep'));
+            });
+        });
+    },
+
+    step1: Em.Route.extend({
+        route: '/step1',
+        connectOutlets: function (router) {
+            var controller = router.get('routerFederationWizardController');
+            controller.dataLoading().done(function () {
+                controller.setCurrentStep('1');
+                controller.connectOutlet('routerFederationWizardStep1', controller.get('content'));
+            })
+        },
+        unroutePath: function () {
+            return false;
+        },
+        next: function (router) {
+            var controller = router.get('routerFederationWizardController');
+            router.transitionTo('step2');
+        }
+    }),
+
+    step2: Em.Route.extend({
+        route: '/step2',
+        connectOutlets: function (router) {
+            var controller = router.get('routerFederationWizardController');
+            controller.dataLoading().done(function () {
+                controller.setCurrentStep('2');
+                controller.loadAllPriorSteps();
+                controller.connectOutlet('routerFederationWizardStep2', controller.get('content'));
+            })
+        },
+        unroutePath: function () {
+            return false;
+        },
+        next: function (router) {
+            var wizardController = router.get('routerFederationWizardController');
+            var stepController = router.get('routerFederationWizardStep2Controller');
+            wizardController.saveMasterComponentHosts(stepController);
+            router.transitionTo('step3');
+        },
+        back: function (router) {
+            router.transitionTo('step1');
+        }
+    }),
+
+    step3: Em.Route.extend({
+        route: '/step3',
+        connectOutlets: function (router) {
+            var controller = router.get('routerFederationWizardController');
+            controller.dataLoading().done(function () {
+                controller.setCurrentStep('3');
+                controller.loadAllPriorSteps();
+                controller.connectOutlet('routerFederationWizardStep3', controller.get('content'));
+            })
+        },
+        unroutePath: function () {
+            return false;
+        },
+        next: function (router) {
+            var controller = router.get('routerFederationWizardController');
+            var stepController = router.get('routerFederationWizardStep3Controller');
+            controller.saveServiceConfigProperties(stepController);
+            router.transitionTo('step4');
+        },
+        back: Em.Router.transitionTo('step2')
+    }),
+
+    step4: Em.Route.extend({
+        route: '/step4',
+        connectOutlets: function (router) {
+            var controller = router.get('routerFederationWizardController');
+            controller.dataLoading().done(function () {
+                controller.setCurrentStep('4');
+                controller.setLowerStepsDisable(4);
+                controller.loadAllPriorSteps();
+                controller.connectOutlet('routerFederationWizardStep4', controller.get('content'));
+            })
+        },
+        unroutePath: function (router, path) {
+            // allow user to leave route if wizard has finished
+            if (router.get('routerFederationWizardController').get('isFinished')) {
+                this._super(router, path);
+            } else {
+                return false;
+            }
+        },
+        next: function (router) {
+            var controller = router.get('routerFederationWizardController');
+            controller.resetOnClose(controller, 'main.services.index');
+        }
+    })
+
+});
\ No newline at end of file
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index bc2c542c8a..6567a92f0d 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -893,6 +893,8 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
 
     enableNameNodeFederation: require('routes/namenode_federation_routes'),
 
+    enableRouterFederation : require('routes/dfsrouter_federation_routes'),
+
     addHawqStandby: require('routes/add_hawq_standby_routes'),
 
     removeHawqStandby: require('routes/remove_hawq_standby_routes'),
diff --git a/ambari-web/app/templates/main/admin/federation/routerBasedFederation/step1.hbs b/ambari-web/app/templates/main/admin/federation/routerBasedFederation/step1.hbs
new file mode 100644
index 0000000000..1576e900d4
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/federation/routerBasedFederation/step1.hbs
@@ -0,0 +1,28 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+<div class="wizard-content col-md-9">
+  <h4 class="step-title">{{t admin.routerFederation.wizard.step1.header}}</h4>
+  <div class="step-description">
+    <p>{{t admin.routerFederation.wizard.step1.body}}</p>
+  </div>
+</div>
+<div class="wizard-footer col-md-12">
+  <div class="btn-area">
+    <button class="btn btn-success pull-right" {{action next target="controller"}}>{{t common.next}} &rarr;</button>
+  </div>
+</div>
\ No newline at end of file
diff --git a/ambari-web/app/templates/main/admin/federation/routerBasedFederation/step3.hbs b/ambari-web/app/templates/main/admin/federation/routerBasedFederation/step3.hbs
new file mode 100644
index 0000000000..41e14ab3b0
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/federation/routerBasedFederation/step3.hbs
@@ -0,0 +1,56 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+<div class="wizard-content col-md-9">
+  <h4 class="step-title">{{t admin.highAvailability.wizard.step3.header}}</h4>
+  <p class="step-description">{{t admin.highAvailability.wizard.step3.confirm.host.body}}</p>
+  <div class="panel panel-default">
+    <div class="panel-body">
+      <div id="ha-step3-content" class="well pre-scrollable">
+        <div id="step8-info">
+          <table id="ha-step3-review-table">
+            {{#each host in view.addRouters}}
+              <tr>
+                <td>{{t admin.routerFederation.wizard.step3.addRouter}}</td>
+                <td>{{host}}</td>
+                <td><span class="to-be-installed-green"><i class="glyphicon glyphicon-plus"></i>&nbsp;{{t admin.routerFederation.wizard.step3.toBeInstalled}}</span></td>
+              </tr>
+            {{/each}}
+          </table>
+        </div>
+      </div>
+      <div id="serviceConfig">
+        {{#if controller.isLoaded}}
+          {{{t admin.routerFederation.wizard.step3.confirm.config.body}}}
+          {{view App.ServiceConfigView isNotEditableBinding="controller.isNotEditable"}}
+        {{else}}
+          {{view App.SpinnerView}}
+        {{/if}}
+      </div>
+    </div>
+  </div>
+</div>
+
+<div class="wizard-footer col-md-12">
+  <div class="btn-area">
+    <a class="btn btn-default" {{action back}}>&larr; {{t common.back}}</a>
+    <button class="btn btn-success pull-right" {{bindAttr disabled="controller.isNextDisabled"}} {{action next}}>{{t common.next}} &rarr;</button>
+    {{#if App.router.nextBtnClickInProgress}}
+      {{view App.SpinnerView tagName="span" classNames="pull-right"}}
+    {{/if}}
+  </div>
+</div>
\ No newline at end of file
diff --git a/ambari-web/app/templates/main/admin/federation/routerBasedFederation/step4.hbs b/ambari-web/app/templates/main/admin/federation/routerBasedFederation/step4.hbs
new file mode 100644
index 0000000000..79f070ab5d
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/federation/routerBasedFederation/step4.hbs
@@ -0,0 +1,19 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+{{template "templates/common/progress"}}
+
diff --git a/ambari-web/app/templates/main/admin/federation/routerBasedFederation/wizard.hbs b/ambari-web/app/templates/main/admin/federation/routerBasedFederation/wizard.hbs
new file mode 100644
index 0000000000..6f81321fd7
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/federation/routerBasedFederation/wizard.hbs
@@ -0,0 +1,35 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<div id="rm-ha-wizard" class="wizard">
+  <div class="wizard-body row">
+    <div class="wizard-nav col-md-3">
+      <ul class="nav nav-pills nav-stacked">
+        <li {{bindAttr class="isStep1:active view.isStep1Disabled:disabled view.isStep1Completed:completed"}}><a href="javascript:void(null);"  {{action gotoStep1 target="controller"}}><i class="step-marker"><span class="step-index">1</span></i><p class="step-name">{{t admin.routerFederation.wizard.step1.header}}</p></a></li>
+        <li {{bindAttr class="isStep2:active view.isStep2Disabled:disabled view.isStep2Completed:completed"}}><a href="javascript:void(null);"  {{action gotoStep2 target="controller"}}><i class="step-marker"><span class="step-index">2</span></i><p class="step-name">{{t admin.routerFederation.wizard.step2.header}}</p></a></li>
+        <li {{bindAttr class="isStep3:active view.isStep3Disabled:disabled view.isStep3Completed:completed"}}><a href="javascript:void(null);"  {{action gotoStep3 target="controller"}}><i class="step-marker"><span class="step-index">3</span></i><p class="step-name">{{t admin.routerFederation.wizard.step3.header}}</p></a></li>
+        <li {{bindAttr class="isStep4:active view.isStep4Disabled:disabled view.isStep4Completed:completed"}}><a href="javascript:void(null);"  {{action gotoStep4 target="controller"}}><i class="step-marker"><span class="step-index">4</span></i><p class="step-name">{{t admin.routerFederation.wizard.step4.header}}</p></a></li>
+      </ul>
+    </div>
+      {{#if view.isLoaded}}
+        {{outlet}}
+      {{else}}
+        {{view App.SpinnerView}}
+      {{/if}}
+  </div>
+</div>
\ No newline at end of file
diff --git a/ambari-web/app/utils/db.js b/ambari-web/app/utils/db.js
index 78bc99af57..701a70cca2 100644
--- a/ambari-web/app/utils/db.js
+++ b/ambari-web/app/utils/db.js
@@ -49,6 +49,7 @@ var InitialData = {
   'ActivateHawqStandbyWizard': {},
   'RAHighAvailabilityWizard': {},
   'NameNodeFederationWizard': {},
+  'RouterFederationWizard': {},
   'RollbackHighAvailabilityWizard': {},
   'MainAdminStackAndUpgrade': {},
   'KerberosDisable': {},
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index c11d1d6332..30aa6bc7ee 100644
--- a/ambari-web/app/views.js
+++ b/ambari-web/app/views.js
@@ -224,6 +224,11 @@ require('views/main/admin/federation/step1_view');
 require('views/main/admin/federation/step2_view');
 require('views/main/admin/federation/step3_view');
 require('views/main/admin/federation/step4_view');
+require('views/main/admin/federation/routerBasedFederation/wizard_view');
+require('views/main/admin/federation/routerBasedFederation/step1_view');
+require('views/main/admin/federation/routerBasedFederation/step2_view');
+require('views/main/admin/federation/routerBasedFederation/step3_view');
+require('views/main/admin/federation/routerBasedFederation/step4_view');
 require('views/main/admin/serviceAccounts_view');
 require('views/main/admin/stack_upgrade/upgrade_wizard_view');
 require('views/main/admin/stack_upgrade/upgrade_version_box_view');
diff --git a/ambari-web/app/views/main/admin/federation/routerBasedFederation/step1_view.js b/ambari-web/app/views/main/admin/federation/routerBasedFederation/step1_view.js
new file mode 100644
index 0000000000..cb4a2086a9
--- /dev/null
+++ b/ambari-web/app/views/main/admin/federation/routerBasedFederation/step1_view.js
@@ -0,0 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+App.RouterFederationWizardStep1View = Em.View.extend({
+
+    templateName: require('templates/main/admin/federation/routerBasedFederation/step1'),
+
+    didInsertElement: function() {
+    }
+
+});
\ No newline at end of file
diff --git a/ambari-web/app/views/main/admin/federation/routerBasedFederation/step2_view.js b/ambari-web/app/views/main/admin/federation/routerBasedFederation/step2_view.js
new file mode 100644
index 0000000000..07c4f3bab0
--- /dev/null
+++ b/ambari-web/app/views/main/admin/federation/routerBasedFederation/step2_view.js
@@ -0,0 +1,25 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+var App = require('app');
+
+App.RouterFederationWizardStep2View = App.AssignMasterComponentsView.extend({
+    title: Em.I18n.t('admin.routerFederation.wizard.step2.header'),
+    alertMessage: Em.computed.i18nFormat('admin.routerFederation.wizard.step2.body', 'controller.content.nameServiceId')
+});
\ No newline at end of file
diff --git a/ambari-web/app/views/main/admin/federation/routerBasedFederation/step3_view.js b/ambari-web/app/views/main/admin/federation/routerBasedFederation/step3_view.js
new file mode 100644
index 0000000000..d79b9f4e0b
--- /dev/null
+++ b/ambari-web/app/views/main/admin/federation/routerBasedFederation/step3_view.js
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+App.RouterFederationWizardStep3View = Em.View.extend({
+
+    templateName: require('templates/main/admin/federation/routerBasedFederation/step3'),
+
+    didInsertElement: function () {
+        this.get('controller').loadStep();
+    },
+    addRouters: function () {
+        return this.get('controller.content.masterComponentHosts').filterProperty('component', 'ROUTER').filterProperty('isInstalled', false).mapProperty('hostName');
+    }.property('controller.content.masterComponentHosts'),
+});
\ No newline at end of file
diff --git a/ambari-web/app/views/main/admin/federation/routerBasedFederation/step4_view.js b/ambari-web/app/views/main/admin/federation/routerBasedFederation/step4_view.js
new file mode 100644
index 0000000000..b4ef26551f
--- /dev/null
+++ b/ambari-web/app/views/main/admin/federation/routerBasedFederation/step4_view.js
@@ -0,0 +1,35 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+App.RouterFederationWizardStep4View = App.HighAvailabilityProgressPageView.extend({
+
+    templateName: require('templates/main/admin/federation/routerBasedFederation/step4'),
+
+    headerTitle: Em.I18n.t('admin.routerFederation.wizard.step4.header'),
+
+    noticeInProgress: Em.I18n.t('admin.routerFederation.wizard.step4.notice.inProgress'),
+
+    noticeCompleted: Em.I18n.t('admin.routerFederation.wizard.step4.notice.completed'),
+
+    submitButtonText: Em.I18n.t('common.complete'),
+
+    labelWidth: 'col-md-5'
+
+});
\ No newline at end of file
diff --git a/ambari-web/app/views/main/admin/federation/routerBasedFederation/wizard_view.js b/ambari-web/app/views/main/admin/federation/routerBasedFederation/wizard_view.js
new file mode 100644
index 0000000000..6c15e364aa
--- /dev/null
+++ b/ambari-web/app/views/main/admin/federation/routerBasedFederation/wizard_view.js
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+var App = require('app');
+
+App.RouterFederationWizardView = Em.View.extend(App.WizardMenuMixin, App.WizardHostsLoading, {
+
+    templateName: require('templates/main/admin/federation/routerBasedFederation/wizard'),
+
+    didInsertElement: function() {
+        var currentStep = this.get('controller.currentStep');
+        if (currentStep > 3) {
+            this.get('controller').setLowerStepsDisable(currentStep);
+        }
+    }
+});
\ No newline at end of file
diff --git a/ambari-web/app/views/main/service/item.js b/ambari-web/app/views/main/service/item.js
index bb61663e0e..b887e1eae1 100644
--- a/ambari-web/app/views/main/service/item.js
+++ b/ambari-web/app/views/main/service/item.js
@@ -241,6 +241,13 @@ App.MainServiceItemView = Em.View.extend(App.HiveInteractiveCheck, {
               break;
           }
         }
+        if (service.get('serviceTypes').contains('DFSRouter') && App.isAuthorized('SERVICE.ENABLE_HA')) {
+          switch (service.get('serviceName')) {
+            case 'HDFS':
+              options.push(actionMap.TOGGLE_RBF_FEDERATION);
+              break;
+          }
+        }
         if (serviceCheckSupported) {
           options.push(actionMap.RUN_SMOKE_TEST);
         }
diff --git a/ambari-web/test/models/service_test.js b/ambari-web/test/models/service_test.js
index c600af6781..fdcd0eb08b 100644
--- a/ambari-web/test/models/service_test.js
+++ b/ambari-web/test/models/service_test.js
@@ -137,7 +137,7 @@ describe('App.Service', function () {
       },
       {
         serviceName: 'HDFS',
-        result: ['HA_MODE', 'FEDERATION']
+        result: ['HA_MODE', 'FEDERATION', 'DFSRouter']
       },
       {
         serviceName: 'YARN',


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ambari.apache.org
For additional commands, e-mail: commits-help@ambari.apache.org