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 (JIRA)" <ji...@apache.org> on 2015/03/25 19:34:54 UTC
[jira] [Commented] (AMBARI-10209) ClusterHostMapping table prevents
cluster deployment, missing host_id column
[ https://issues.apache.org/jira/browse/AMBARI-10209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14380448#comment-14380448 ]
Alejandro Fernandez commented on AMBARI-10209:
----------------------------------------------
I tested the fix works by copying the sql script to a brand new install of the rpms, but before running ambari-server setup -s
and was able to start ambari-server.
> ClusterHostMapping table prevents cluster deployment, missing host_id column
> ----------------------------------------------------------------------------
>
> Key: AMBARI-10209
> URL: https://issues.apache.org/jira/browse/AMBARI-10209
> Project: Ambari
> Issue Type: Bug
> Components: ambari-server
> Affects Versions: 2.1.0
> Reporter: Alejandro Fernandez
> Assignee: Alejandro Fernandez
> Priority: Critical
> Fix For: 2.1.0
>
> Attachments: AMBARI-10209.patch
>
>
> When deploying a new cluster, the embedded Postgres SQL file has incorrect columns for the ClusterHostMapping table.
> {code}
> psql:/Users/*/src/hwx/ambari/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql:652: ERROR: column "host_id" referenced in foreign key constraint does not exist
> {code}
> {code:title=During deployment...}
> [3/25/15, 1:53:28 PM] Internal Exception: org.postgresql.util.PSQLException: ERROR: column t0.host_id does not exist
> [3/25/15, 1:54:00 PM] Query: ReadAllQuery(name="hostEntities" referenceClass=HostEntity sql="SELECT t1.id, t1.cpu_count, t1.cpu_info, t1.discovery_status, t1.host_attributes, t1.host_name, t1.ipv4, t1.ipv6, t1.last_registration_time, t1.os_arch, t1.os_info, t1.os_type, t1.ph_cpu_count, t1.public_host_name, t1.rack_info, t1.total_mem FROM ClusterHostMapping t0, hosts t1 WHERE ((t0.cluster_id = ?) AND (t1.id = t0.host_id))")
> {code}
> It looks like the host_id is commented out of the table. Correcting this causes:
> {code}
> Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "host_name" violates not-null constraint
> {code}
> It looks like the correct table declaration is:
> {code}
> CREATE TABLE ambari.ClusterHostMapping (
> cluster_id BIGINT NOT NULL,
> host_id BIGINT NOT NULL,
> PRIMARY KEY (cluster_id, host_id));
> GRANT ALL PRIVILEGES ON TABLE ambari.ClusterHostMapping TO :username;
> {code}
> It looks like all of the SQL files have this problem...
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)