You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Alejandro Fernandez <af...@hortonworks.com> on 2015/04/24 03:48:44 UTC
Re: Review Request 33500: Full Delete of Host : Switch
requestoperationlevel
and kerberos_principal_host tables to use host_id instead of host_name column
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33500/
-----------------------------------------------------------
(Updated April 24, 2015, 1:48 a.m.)
Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
Bugs: AMBARI-10717
https://issues.apache.org/jira/browse/AMBARI-10717
Repository: ambari
Description
-------
As part of AMBARI-10167 (Delete a host from Ambari cluster is not clean; fails to re-add the same host), need to refactor requestoperationlevel and kerberos_principal_host tables to use a new host_id column instead of host_name.
Diffs
-----
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Request.java ab81dfd
ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java 9bdc4b7
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosPrincipalHostDAO.java 64e18bb
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/KerberosPrincipalHostEntity.java 07c960d
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/KerberosPrincipalHostEntityPK.java 704476e
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestOperationLevelEntity.java 9f8453c
ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java 5e8b451
ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java f8066ca
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java 6249d2a
ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1a146e0
ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql bc6bd32
ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql f2a016f
ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql 38a241d
ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 30959d0
ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java 714b6b7
Diff: https://reviews.apache.org/r/33500/diff/
Testing (updated)
-------
Made schema changes on a live cluster, and was able to create requests and kerberize the cluster (which inserts records into kerberos_principal_host) table.
All unit tests passed on my Mac except 3 unrelated tests that are also failing on trunk in my environment.
test220Cardinality(org.apache.ambari.server.api.services.KerberosServiceMetaInfoTest): Guice provision errors:(..)
test220AutoDeploy(org.apache.ambari.server.api.services.KerberosServiceMetaInfoTest): Guice provision errors:(..)
test220Dependencies(org.apache.ambari.server.api.services.KerberosServiceMetaInfoTest): Guice provision errors:(..)
Schema changes needed:
```
ALTER TABLE kerberos_principal_host DROP CONSTRAINT kerberos_principal_host_pkey;
ALTER TABLE kerberos_principal_host ADD COLUMN host_id BIGINT NOT NULL;
ALTER TABLE kerberos_principal_host ADD CONSTRAINT kerberos_principal_host_pkey PRIMARY KEY (principal_name, host_id);
ALTER TABLE kerberos_principal_host ADD CONSTRAINT FK_krb_pr_host_host_id FOREIGN KEY (host_id) REFERENCES hosts (host_id);
ALTER TABLE kerberos_principal_host DROP COLUMN host_name;
ALTER TABLE requestoperationlevel ADD COLUMN host_id BIGINT NOT NULL;
ALTER TABLE requestoperationlevel DROP COLUMN host_name;
```
Sample API to insert a record into requestoperationlevel table,
```
Restart single component on a host, at the host-level
curl -X POST -u admin:admin -H 'X-Requested-By:1' http://c6408.ambari.apache.org:8080/api/v1/clusters/c1/requests -d '{"RequestInfo":{"command":"RESTART", "context":"Restart ZooKeeper Client on c6408.ambari.apache.org", "operation_level":{ "level":"HOST", "cluster_name":"c1", "host_name": "c6408.ambari.apache.org"}}, "Requests/resource_filters": [{"service_name":"ZOOKEEPER", "component_name":"ZOOKEEPER_CLIENT", "hosts":"c6408.ambari.apache.org"}]}'
```
Thanks,
Alejandro Fernandez
Re: Review Request 33500: Full Delete of Host : Switch
requestoperationlevel
and kerberos_principal_host tables to use host_id instead of host_name column
Posted by Robert Levas <rl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33500/#review81516
-----------------------------------------------------------
Ship it!
ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
<https://reviews.apache.org/r/33500/#comment131906>
Seems like an exception should be thrown here, but I am not sure what implications that might have with processing heartbeats
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosPrincipalHostDAO.java
<https://reviews.apache.org/r/33500/#comment131908>
LOng --> Long
- Robert Levas
On April 24, 2015, 2:37 p.m., Alejandro Fernandez wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33500/
> -----------------------------------------------------------
>
> (Updated April 24, 2015, 2:37 p.m.)
>
>
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
>
>
> Bugs: AMBARI-10717
> https://issues.apache.org/jira/browse/AMBARI-10717
>
>
> Repository: ambari
>
>
> Description
> -------
>
> As part of AMBARI-10167 (Delete a host from Ambari cluster is not clean; fails to re-add the same host), need to refactor requestoperationlevel and kerberos_principal_host tables to use a new host_id column instead of host_name.
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Request.java ab81dfd
> ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java 9bdc4b7
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosPrincipalHostDAO.java 64e18bb
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/KerberosPrincipalHostEntity.java 07c960d
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/KerberosPrincipalHostEntityPK.java 704476e
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestOperationLevelEntity.java 9f8453c
> ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java 5e8b451
> ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java f8066ca
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java 6249d2a
> ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1a146e0
> ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql bc6bd32
> ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql f2a016f
> ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql 38a241d
> ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 30959d0
> ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java 714b6b7
>
> Diff: https://reviews.apache.org/r/33500/diff/
>
>
> Testing
> -------
>
> Made schema changes on a live cluster, and was able to create requests and kerberize the cluster (which inserts records into kerberos_principal_host) table.
>
> All unit tests passed on my Mac except 3 unrelated tests that are also failing on trunk in my environment.
> test220Cardinality(org.apache.ambari.server.api.services.KerberosServiceMetaInfoTest): Guice provision errors:(..)
> test220AutoDeploy(org.apache.ambari.server.api.services.KerberosServiceMetaInfoTest): Guice provision errors:(..)
> test220Dependencies(org.apache.ambari.server.api.services.KerberosServiceMetaInfoTest): Guice provision errors:(..)
>
> Schema changes needed:
> ```
> ALTER TABLE kerberos_principal_host DROP CONSTRAINT kerberos_principal_host_pkey;
> ALTER TABLE kerberos_principal_host ADD COLUMN host_id BIGINT NOT NULL;
> ALTER TABLE kerberos_principal_host ADD CONSTRAINT kerberos_principal_host_pkey PRIMARY KEY (principal_name, host_id);
> ALTER TABLE kerberos_principal_host ADD CONSTRAINT FK_krb_pr_host_host_id FOREIGN KEY (host_id) REFERENCES hosts (host_id);
> ALTER TABLE kerberos_principal_host DROP COLUMN host_name;
>
> ALTER TABLE requestoperationlevel ADD COLUMN host_id BIGINT NOT NULL;
> ALTER TABLE requestoperationlevel DROP COLUMN host_name;
> ```
>
> Sample API to insert a record into requestoperationlevel table,
> ```
> Restart single component on a host, at the host-level
> curl -X POST -u admin:admin -H 'X-Requested-By:1' http://c6408.ambari.apache.org:8080/api/v1/clusters/c1/requests -d '{"RequestInfo":{"command":"RESTART", "context":"Restart ZooKeeper Client on c6408.ambari.apache.org", "operation_level":{ "level":"HOST", "cluster_name":"c1", "host_name": "c6408.ambari.apache.org"}}, "Requests/resource_filters": [{"service_name":"ZOOKEEPER", "component_name":"ZOOKEEPER_CLIENT", "hosts":"c6408.ambari.apache.org"}]}'
> ```
>
>
> Thanks,
>
> Alejandro Fernandez
>
>
Re: Review Request 33500: Full Delete of Host : Switch
requestoperationlevel
and kerberos_principal_host tables to use host_id instead of host_name column
Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33500/
-----------------------------------------------------------
(Updated April 24, 2015, 6:37 p.m.)
Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
Changes
-------
Addressed comments.
Bugs: AMBARI-10717
https://issues.apache.org/jira/browse/AMBARI-10717
Repository: ambari
Description
-------
As part of AMBARI-10167 (Delete a host from Ambari cluster is not clean; fails to re-add the same host), need to refactor requestoperationlevel and kerberos_principal_host tables to use a new host_id column instead of host_name.
Diffs (updated)
-----
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Request.java ab81dfd
ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java 9bdc4b7
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosPrincipalHostDAO.java 64e18bb
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/KerberosPrincipalHostEntity.java 07c960d
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/KerberosPrincipalHostEntityPK.java 704476e
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestOperationLevelEntity.java 9f8453c
ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java 5e8b451
ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java f8066ca
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java 6249d2a
ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1a146e0
ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql bc6bd32
ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql f2a016f
ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql 38a241d
ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 30959d0
ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java 714b6b7
Diff: https://reviews.apache.org/r/33500/diff/
Testing
-------
Made schema changes on a live cluster, and was able to create requests and kerberize the cluster (which inserts records into kerberos_principal_host) table.
All unit tests passed on my Mac except 3 unrelated tests that are also failing on trunk in my environment.
test220Cardinality(org.apache.ambari.server.api.services.KerberosServiceMetaInfoTest): Guice provision errors:(..)
test220AutoDeploy(org.apache.ambari.server.api.services.KerberosServiceMetaInfoTest): Guice provision errors:(..)
test220Dependencies(org.apache.ambari.server.api.services.KerberosServiceMetaInfoTest): Guice provision errors:(..)
Schema changes needed:
```
ALTER TABLE kerberos_principal_host DROP CONSTRAINT kerberos_principal_host_pkey;
ALTER TABLE kerberos_principal_host ADD COLUMN host_id BIGINT NOT NULL;
ALTER TABLE kerberos_principal_host ADD CONSTRAINT kerberos_principal_host_pkey PRIMARY KEY (principal_name, host_id);
ALTER TABLE kerberos_principal_host ADD CONSTRAINT FK_krb_pr_host_host_id FOREIGN KEY (host_id) REFERENCES hosts (host_id);
ALTER TABLE kerberos_principal_host DROP COLUMN host_name;
ALTER TABLE requestoperationlevel ADD COLUMN host_id BIGINT NOT NULL;
ALTER TABLE requestoperationlevel DROP COLUMN host_name;
```
Sample API to insert a record into requestoperationlevel table,
```
Restart single component on a host, at the host-level
curl -X POST -u admin:admin -H 'X-Requested-By:1' http://c6408.ambari.apache.org:8080/api/v1/clusters/c1/requests -d '{"RequestInfo":{"command":"RESTART", "context":"Restart ZooKeeper Client on c6408.ambari.apache.org", "operation_level":{ "level":"HOST", "cluster_name":"c1", "host_name": "c6408.ambari.apache.org"}}, "Requests/resource_filters": [{"service_name":"ZOOKEEPER", "component_name":"ZOOKEEPER_CLIENT", "hosts":"c6408.ambari.apache.org"}]}'
```
Thanks,
Alejandro Fernandez
Re: Review Request 33500: Full Delete of Host : Switch
requestoperationlevel
and kerberos_principal_host tables to use host_id instead of host_name column
Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33500/#review81452
-----------------------------------------------------------
Ship it!
ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
<https://reviews.apache.org/r/33500/#comment131834>
Any reason you put the cascade here and not in JPA?
- Jonathan Hurley
On April 23, 2015, 9:48 p.m., Alejandro Fernandez wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33500/
> -----------------------------------------------------------
>
> (Updated April 23, 2015, 9:48 p.m.)
>
>
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
>
>
> Bugs: AMBARI-10717
> https://issues.apache.org/jira/browse/AMBARI-10717
>
>
> Repository: ambari
>
>
> Description
> -------
>
> As part of AMBARI-10167 (Delete a host from Ambari cluster is not clean; fails to re-add the same host), need to refactor requestoperationlevel and kerberos_principal_host tables to use a new host_id column instead of host_name.
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Request.java ab81dfd
> ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java 9bdc4b7
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosPrincipalHostDAO.java 64e18bb
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/KerberosPrincipalHostEntity.java 07c960d
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/KerberosPrincipalHostEntityPK.java 704476e
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestOperationLevelEntity.java 9f8453c
> ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java 5e8b451
> ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java f8066ca
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java 6249d2a
> ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1a146e0
> ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql bc6bd32
> ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql f2a016f
> ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql 38a241d
> ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 30959d0
> ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java 714b6b7
>
> Diff: https://reviews.apache.org/r/33500/diff/
>
>
> Testing
> -------
>
> Made schema changes on a live cluster, and was able to create requests and kerberize the cluster (which inserts records into kerberos_principal_host) table.
>
> All unit tests passed on my Mac except 3 unrelated tests that are also failing on trunk in my environment.
> test220Cardinality(org.apache.ambari.server.api.services.KerberosServiceMetaInfoTest): Guice provision errors:(..)
> test220AutoDeploy(org.apache.ambari.server.api.services.KerberosServiceMetaInfoTest): Guice provision errors:(..)
> test220Dependencies(org.apache.ambari.server.api.services.KerberosServiceMetaInfoTest): Guice provision errors:(..)
>
> Schema changes needed:
> ```
> ALTER TABLE kerberos_principal_host DROP CONSTRAINT kerberos_principal_host_pkey;
> ALTER TABLE kerberos_principal_host ADD COLUMN host_id BIGINT NOT NULL;
> ALTER TABLE kerberos_principal_host ADD CONSTRAINT kerberos_principal_host_pkey PRIMARY KEY (principal_name, host_id);
> ALTER TABLE kerberos_principal_host ADD CONSTRAINT FK_krb_pr_host_host_id FOREIGN KEY (host_id) REFERENCES hosts (host_id);
> ALTER TABLE kerberos_principal_host DROP COLUMN host_name;
>
> ALTER TABLE requestoperationlevel ADD COLUMN host_id BIGINT NOT NULL;
> ALTER TABLE requestoperationlevel DROP COLUMN host_name;
> ```
>
> Sample API to insert a record into requestoperationlevel table,
> ```
> Restart single component on a host, at the host-level
> curl -X POST -u admin:admin -H 'X-Requested-By:1' http://c6408.ambari.apache.org:8080/api/v1/clusters/c1/requests -d '{"RequestInfo":{"command":"RESTART", "context":"Restart ZooKeeper Client on c6408.ambari.apache.org", "operation_level":{ "level":"HOST", "cluster_name":"c1", "host_name": "c6408.ambari.apache.org"}}, "Requests/resource_filters": [{"service_name":"ZOOKEEPER", "component_name":"ZOOKEEPER_CLIENT", "hosts":"c6408.ambari.apache.org"}]}'
> ```
>
>
> Thanks,
>
> Alejandro Fernandez
>
>
Re: Review Request 33500: Full Delete of Host : Switch
requestoperationlevel
and kerberos_principal_host tables to use host_id instead of host_name column
Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33500/#review81465
-----------------------------------------------------------
Ship it!
Ship It!
- Dmitro Lisnichenko
On April 24, 2015, 1:48 a.m., Alejandro Fernandez wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33500/
> -----------------------------------------------------------
>
> (Updated April 24, 2015, 1:48 a.m.)
>
>
> Review request for Ambari, Dmitro Lisnichenko, Jonathan Hurley, Sumit Mohanty, and Sid Wagle.
>
>
> Bugs: AMBARI-10717
> https://issues.apache.org/jira/browse/AMBARI-10717
>
>
> Repository: ambari
>
>
> Description
> -------
>
> As part of AMBARI-10167 (Delete a host from Ambari cluster is not clean; fails to re-add the same host), need to refactor requestoperationlevel and kerberos_principal_host tables to use a new host_id column instead of host_name.
>
>
> Diffs
> -----
>
> ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Request.java ab81dfd
> ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java 9bdc4b7
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosPrincipalHostDAO.java 64e18bb
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/KerberosPrincipalHostEntity.java 07c960d
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/KerberosPrincipalHostEntityPK.java 704476e
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/RequestOperationLevelEntity.java 9f8453c
> ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java 5e8b451
> ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java f8066ca
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog210.java 6249d2a
> ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 1a146e0
> ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql bc6bd32
> ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql f2a016f
> ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql 38a241d
> ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql 30959d0
> ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog210Test.java 714b6b7
>
> Diff: https://reviews.apache.org/r/33500/diff/
>
>
> Testing
> -------
>
> Made schema changes on a live cluster, and was able to create requests and kerberize the cluster (which inserts records into kerberos_principal_host) table.
>
> All unit tests passed on my Mac except 3 unrelated tests that are also failing on trunk in my environment.
> test220Cardinality(org.apache.ambari.server.api.services.KerberosServiceMetaInfoTest): Guice provision errors:(..)
> test220AutoDeploy(org.apache.ambari.server.api.services.KerberosServiceMetaInfoTest): Guice provision errors:(..)
> test220Dependencies(org.apache.ambari.server.api.services.KerberosServiceMetaInfoTest): Guice provision errors:(..)
>
> Schema changes needed:
> ```
> ALTER TABLE kerberos_principal_host DROP CONSTRAINT kerberos_principal_host_pkey;
> ALTER TABLE kerberos_principal_host ADD COLUMN host_id BIGINT NOT NULL;
> ALTER TABLE kerberos_principal_host ADD CONSTRAINT kerberos_principal_host_pkey PRIMARY KEY (principal_name, host_id);
> ALTER TABLE kerberos_principal_host ADD CONSTRAINT FK_krb_pr_host_host_id FOREIGN KEY (host_id) REFERENCES hosts (host_id);
> ALTER TABLE kerberos_principal_host DROP COLUMN host_name;
>
> ALTER TABLE requestoperationlevel ADD COLUMN host_id BIGINT NOT NULL;
> ALTER TABLE requestoperationlevel DROP COLUMN host_name;
> ```
>
> Sample API to insert a record into requestoperationlevel table,
> ```
> Restart single component on a host, at the host-level
> curl -X POST -u admin:admin -H 'X-Requested-By:1' http://c6408.ambari.apache.org:8080/api/v1/clusters/c1/requests -d '{"RequestInfo":{"command":"RESTART", "context":"Restart ZooKeeper Client on c6408.ambari.apache.org", "operation_level":{ "level":"HOST", "cluster_name":"c1", "host_name": "c6408.ambari.apache.org"}}, "Requests/resource_filters": [{"service_name":"ZOOKEEPER", "component_name":"ZOOKEEPER_CLIENT", "hosts":"c6408.ambari.apache.org"}]}'
> ```
>
>
> Thanks,
>
> Alejandro Fernandez
>
>