ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alejandro Fernandez (JIRA)" <>
Subject [jira] [Created] (AMBARI-10209) ClusterHostMapping table prevents cluster deployment, missing host_id column
Date Wed, 25 Mar 2015 18:23:53 GMT
Alejandro Fernandez created AMBARI-10209:

             Summary: ClusterHostMapping table prevents cluster deployment, missing host_id
                 Key: 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

When deploying a new cluster, the embedded Postgres SQL file has incorrect columns for the
ClusterHostMapping table.

ERROR:  column "host_id" referenced in foreign key constraint does not exist

{code:title=During deployment...}
[3/25/15, 1:53:28 PM] Jonathan Hurley: Internal Exception: org.postgresql.util.PSQLException:
ERROR: column t0.host_id does not exist
[3/25/15, 1:54:00 PM] Jonathan Hurley: Query: ReadAllQuery(name="hostEntities" referenceClass=HostEntity
sql="SELECT, 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 ( = t0.host_id))")

It looks like the host_id is commented out of the table. Correcting this causes:
Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "host_name" violates
not-null constraint

It looks like the correct table declaration is:
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;

It looks like all of the SQL files have this problem...

This message was sent by Atlassian JIRA

View raw message