@@ -584,6 +584,39 @@ fn build_rolegroup_config_map(
584
584
hbase_site_config
585
585
. extend ( hbase_opa_config. map_or ( vec ! [ ] , |config| config. hbase_site_config ( ) ) ) ;
586
586
587
+ match hbase_role {
588
+ HbaseRole :: Master => {
589
+ hbase_site_config. insert (
590
+ "hbase.master.hostname" . to_string ( ) ,
591
+ "${HBASE_SERVICE_HOST}" . to_string ( ) ,
592
+ ) ;
593
+ hbase_site_config. insert (
594
+ "hbase.master.port" . to_string ( ) ,
595
+ "${HBASE_SERVICE_PORT}" . to_string ( ) ,
596
+ )
597
+ }
598
+ HbaseRole :: RegionServer => {
599
+ hbase_site_config. insert (
600
+ "hbase.regionserver.hostname" . to_string ( ) ,
601
+ "${HBASE_SERVICE_HOST}" . to_string ( ) ,
602
+ ) ;
603
+ hbase_site_config. insert (
604
+ "hbase.regionserver.port" . to_string ( ) ,
605
+ "${HBASE_SERVICE_PORT}" . to_string ( ) ,
606
+ )
607
+ }
608
+ HbaseRole :: RestServer => {
609
+ hbase_site_config. insert (
610
+ "hbase.rest.hostname" . to_string ( ) ,
611
+ "${HBASE_SERVICE_HOST}" . to_string ( ) ,
612
+ ) ;
613
+ hbase_site_config. insert (
614
+ "hbase.rest.port" . to_string ( ) ,
615
+ "${HBASE_SERVICE_PORT}" . to_string ( ) ,
616
+ )
617
+ }
618
+ } ;
619
+
587
620
// configOverride come last
588
621
hbase_site_config. extend ( config. clone ( ) ) ;
589
622
hbase_site_xml = to_hadoop_xml (
@@ -868,7 +901,15 @@ fn build_rolegroup_statefulset(
868
901
. image_from_product_image ( resolved_product_image)
869
902
. command ( command ( ) )
870
903
. args ( vec ! [ formatdoc! { "
904
+ {wait}
905
+ {list}
906
+ {update_host}
907
+ {update_port}
871
908
{entrypoint} {role} {domain} {port}" ,
909
+ wait = "until [ -f /stackable/conf/hbase-site.xml ]; do sleep 1; done;" . to_string( ) ,
910
+ list = "ls -al /stackable/conf/hbase-site.xml" . to_string( ) ,
911
+ update_host = "sed -i 's|\\ ${HBASE_SERVICE_HOST}|${HBASE_SERVICE_HOST}|g' /stackable/conf/hbase-site.xml" . to_string( ) ,
912
+ update_port = "sed -i 's|\\ ${HBASE_SERVICE_PORT}|${HBASE_SERVICE_PORT}|g' /stackable/conf/hbase-site.xml" . to_string( ) ,
872
913
entrypoint = "/stackable/hbase/bin/hbase-entrypoint.sh" . to_string( ) ,
873
914
role = role_name,
874
915
domain = hbase_service_domain_name( hbase, rolegroup_ref, cluster_info) ?,
@@ -1137,21 +1178,27 @@ fn build_hbase_env_sh(
1137
1178
construct_role_specific_non_heap_jvm_args ( hbase, hbase_role, role_group, product_version)
1138
1179
. context ( ConstructJvmArgumentSnafu ) ?;
1139
1180
let port_name = & hbase. ui_port_name ( ) ;
1181
+
1182
+ result. insert (
1183
+ "HBASE_SERVICE_HOST" . to_owned ( ) ,
1184
+ format ! ( "$(cat {LISTENER_VOLUME_DIR}/default-address/address)" ) ,
1185
+ ) ;
1186
+ result. insert (
1187
+ "HBASE_SERVICE_PORT" . to_owned ( ) ,
1188
+ format ! ( "$(cat {LISTENER_VOLUME_DIR}/default-address/ports/{port_name})" ) ,
1189
+ ) ;
1190
+
1140
1191
match hbase_role {
1141
1192
HbaseRole :: Master => {
1142
1193
result. insert (
1143
1194
"HBASE_MASTER_OPTS" . to_string ( ) ,
1144
- format ! (
1145
- "{role_specific_non_heap_jvm_args} -Dhbase.master.hostname=$(cat {LISTENER_VOLUME_DIR}/default-address/address) -Dhbase.master.port=$(cat {LISTENER_VOLUME_DIR}/default-address/ports/{port_name})"
1146
- )
1195
+ role_specific_non_heap_jvm_args,
1147
1196
) ;
1148
1197
}
1149
1198
HbaseRole :: RegionServer => {
1150
1199
result. insert (
1151
1200
"HBASE_REGIONSERVER_OPTS" . to_string ( ) ,
1152
- format ! (
1153
- "{role_specific_non_heap_jvm_args} -Dhbase.regionserver.hostname=$(cat {LISTENER_VOLUME_DIR}/default-address/address) -Dhbase.regionserver.port=$(cat {LISTENER_VOLUME_DIR}/default-address/ports/{port_name})"
1154
- )
1201
+ role_specific_non_heap_jvm_args,
1155
1202
) ;
1156
1203
}
1157
1204
HbaseRole :: RestServer => {
0 commit comments