@@ -109,8 +109,8 @@ def __generate_single_node_inner_config__(self, tpl_config_path, node_path, priv
109109 self .__generate_storage_config__ (
110110 config_content , node_config .storage_config )
111111 # load the hdfs_storage_config
112- self .__generate_hdfs_storage_config__ (
113- config_content , node_config .hdfs_storage_config )
112+ self .__generate_hdfs_storage_config__ (node_path , utilities . ConfigInfo . krb5_config_tpl_path ,
113+ config_content , node_config .hdfs_storage_config )
114114 # load the ra2018psi config
115115 self .__generate_ra2018psi_config__ (
116116 config_content , node_config .ra2018psi_config )
@@ -182,7 +182,7 @@ def __generate_storage_config__(self, config_content, storage_config):
182182 config_content [section_name ]["password" ] = storage_config .password
183183 config_content [section_name ]["database" ] = storage_config .database
184184
185- def __generate_hdfs_storage_config__ (self , config_content , hdfs_storage_config ):
185+ def __generate_hdfs_storage_config__ (self , node_path , krb5_tpl_file_path , config_content , hdfs_storage_config ):
186186 if hdfs_storage_config is None :
187187 return
188188 section_name = "hdfs_storage"
@@ -195,6 +195,18 @@ def __generate_hdfs_storage_config__(self, config_content, hdfs_storage_config):
195195 config_content [section_name ]["auth_principal" ] = hdfs_storage_config .auth_principal
196196 config_content [section_name ]["auth_password" ] = hdfs_storage_config .auth_password
197197 config_content [section_name ]["ccache_path" ] = hdfs_storage_config .ccache_path
198+ config_content [section_name ]["krb5_conf_path" ] = hdfs_storage_config .krb5_conf_path
199+ # copy krb5.conf to krb5_conf_path specified path
200+ dst_path = os .path .join (node_path , hdfs_storage_config .krb5_conf_path )
201+ if hdfs_storage_config .krb5_conf_path .startswith ("/" ):
202+ dst_path = hdfs_storage_config .krb5_conf_path
203+ command = "cp %s %s" % (krb5_tpl_file_path , dst_path )
204+ (ret , output ) = utilities .execute_command_and_getoutput (command )
205+ if ret is False :
206+ utilities .log_error ("copy krb5 configuration from %s to %s failed, error: %s" ) % (
207+ krb5_tpl_file_path , dst_path , output )
208+ return False
209+ return True
198210
199211 def __generate_transport_config__ (self , config_content ,
200212 node_config , node_id ,
0 commit comments