Support Questions
Find answers, ask questions, and share your expertise

Install Ranger via blueprint

When installing Ranger via a blueprint I get the following exception:

2017-02-13 18:22:10,754  [E] create_dbversion_catalog.sql file import failed!
2017-02-13 18:22:40,763  [JISQL] /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/bin/java -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-connector-java.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://mn01.vagrant  :3306/ranger -u 'ranger' -p '********' -noheader -trim -c \; -query "show tables like 'x_db_version_h';"
SQLException : SQL state: 3D000 java.sql.SQLException: No database selected ErrorCode: 1046
SQLException : SQL state: 3D000 java.sql.SQLException: No database selected ErrorCode: 1046
2017-02-13 18:22:41,149  [I] Table x_db_version_h does not exist in database ranger
2017-02-13 18:22:41,149  [JISQL] /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/bin/java -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-connector-java.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://mn01.vagrant  :3306/ranger -u 'ranger' -p '********' -noheader -trim -c \; -input /usr/hdp/current/ranger-admin/db/mysql/create_dbversion_catalog.sql
Error executing: create table if not exists x_db_version_h  ( 	id				bigint not null auto_increment primary key, 	version   		varchar(64) not null, 	inst_at 	    timestamp not null default current_timestamp, 	inst_by 	    varchar(256) not null, 	updated_at      timestamp null default null,     updated_by      varchar(256) not null, 	active          ENUM('Y', 'N') default 'Y' ) ; 
java.sql.SQLException: No database selected
SQLException : SQL state: 3D000 java.sql.SQLException: No database selected ErrorCode: 1046
2017-02-13 18:22:41,556  [E] create_dbversion_catalog.sql file import failed!

The blueprint's json can be found here: https://gist.github.com/geoHeil/bbe4eb9cef4f4e6c2feca743f2b19bc8

The complete input json is found here

https://gist.github.com/geoHeil/b54181d35c0d4549c0da25465cc93e29 and the full output txt

1 ACCEPTED SOLUTION

@Georg Heiler

Just reviewing the your blueprint json content at https://gist.github.com/geoHeil/bbe4eb9cef4f4e6c2feca743f2b19bc8

can you please check why there is a space between hostname and port number for db_host and policymanager_external_url? Please correct and try again.

"policymgr_external_url" : "http:// mn01.vagrant :6080",
"db_host" : " mn01.vagrant :3306",

View solution in original post

2 REPLIES 2

@Georg Heiler

Just reviewing the your blueprint json content at https://gist.github.com/geoHeil/bbe4eb9cef4f4e6c2feca743f2b19bc8

can you please check why there is a space between hostname and port number for db_host and policymanager_external_url? Please correct and try again.

"policymgr_external_url" : "http:// mn01.vagrant :6080",
"db_host" : " mn01.vagrant :3306",

I used```

"policymgr_external_url" : "https://{% if isSingleNode %} {{ groups[cluster_name+'_mn01'][0] }} {% else %} {{ groups[cluster_name+'_mn03'][0] }} {% endif %}:6182", {% else %} "policymgr_external_url" : "http://{% if isSingleNode %} {{ groups[cluster_name+'_mn01'][0] }} {% else %} {{ groups[cluster_name+'_mn03'][0] }}{% endif %}:6080", {% endif %}

```

to create the JSON. It is adopted from https://github.com/bushnoh/ansible-hadoop-asap/blob/master/blueprints/bare_cluster.bp.j2

When removing the spaces inn all places ineed, finally ambari successfully installs ranger.

; ;