def _setup_remote_server(self, properties): if self.ensure_jdbc_driver_installed(properties): properties.removeOldProp(self.dbPropKeys.port_key) properties.removeOldProp(self.dbAuthKeys.integrated_auth_key) properties.removeOldProp(self.dbAuthKeys.user_name_key) properties.removeOldProp(self.dbAuthKeys.password_key) properties.process_pair(self.persistence_property, 'remote') properties.process_pair(self.dbPropKeys.dbms_key, self.dbms) properties.process_pair(self.dbPropKeys.driver_key, self.driver_class_name) properties.process_pair( self.dbPropKeys.server_key, ensure_double_backslashes(self.database_host)) if self.database_port is not None and self.database_port != "": properties.process_pair(self.dbPropKeys.port_key, self.database_port) properties.process_pair(self.dbPropKeys.db_name_key, self.database_name) self._store_db_auth_config(properties, self.dbAuthKeys) properties.process_pair(self.dbPropKeys.db_url_key, self.database_url) pass
def _build_sql_server_connection_string(self): databaseUrl = "jdbc:sqlserver://{0}".format(ensure_double_backslashes(self.database_host)) if self.database_port is not None and self.database_port != "": databaseUrl += ":{0}".format(self.database_port) databaseUrl += ";databaseName={0}".format(self.database_name) if(self.use_windows_authentication): databaseUrl += ";integratedSecurity=true" #No need to append the username and password, the Ambari server adds them by itself when connecting to the database return databaseUrl
def _setup_remote_server(self, properties): super(SQLServerAmbariDBConfig, self)._setup_remote_server(properties) properties.process_pair(JDBC_RCA_DRIVER_PROPERTY, self.driver_class_name) properties.process_pair(JDBC_RCA_HOSTNAME_PROPERTY, ensure_double_backslashes(self.database_host)) if self.database_port is not None and self.database_port != "": properties.process_pair(JDBC_RCA_PORT_PROPERTY, self.database_port) authKeys = SqlServerAuthenticationKeys( JDBC_RCA_USE_INTEGRATED_AUTH_PROPERTY, JDBC_RCA_USER_NAME_PROPERTY, JDBC_RCA_PASSWORD_FILE_PROPERTY, JDBC_RCA_PASSWORD_ALIAS, JDBC_PASSWORD_FILENAME) self._store_db_auth_config(properties, authKeys) properties.process_pair(JDBC_RCA_URL_PROPERTY, self.database_url) pass
def _setup_remote_server(self, properties): super(SQLServerAmbariDBConfig, self)._setup_remote_server(properties) properties.process_pair(JDBC_RCA_DRIVER_PROPERTY, self.driver_class_name) properties.process_pair(JDBC_RCA_HOSTNAME_PROPERTY, ensure_double_backslashes(self.database_host)) if self.database_port is not None and self.database_port != "": properties.process_pair(JDBC_RCA_PORT_PROPERTY, self.database_port) authKeys = SqlServerAuthenticationKeys( JDBC_RCA_USE_INTEGRATED_AUTH_PROPERTY, JDBC_RCA_USER_NAME_PROPERTY, JDBC_RCA_PASSWORD_FILE_PROPERTY, JDBC_RCA_PASSWORD_ALIAS, JDBC_PASSWORD_FILENAME ) self._store_db_auth_config(properties, authKeys) properties.process_pair(JDBC_RCA_URL_PROPERTY, self.database_url) pass
def _setup_remote_server(self, properties): if self.ensure_jdbc_driver_installed(properties): properties.removeOldProp(self.dbPropKeys.port_key) properties.removeOldProp(self.dbAuthKeys.integrated_auth_key) properties.removeOldProp(self.dbAuthKeys.user_name_key) properties.removeOldProp(self.dbAuthKeys.password_key) properties.process_pair(self.persistence_property, 'remote') properties.process_pair(self.dbPropKeys.dbms_key, self.dbms) properties.process_pair(self.dbPropKeys.driver_key, self.driver_class_name) properties.process_pair(self.dbPropKeys.server_key, ensure_double_backslashes(self.database_host)) if self.database_port is not None and self.database_port != "": properties.process_pair(self.dbPropKeys.port_key, self.database_port) properties.process_pair(self.dbPropKeys.db_name_key, self.database_name) self._store_db_auth_config(properties, self.dbAuthKeys) properties.process_pair(self.dbPropKeys.db_url_key, self.database_url) pass
""" from ambari_commons.str_utils import ensure_double_backslashes from resource_management import * # server configurations config = Script.get_config() # notused zookeeper_home_dir = os.environ["ZOOKEEPER_HOME"] zookeeper_conf_dir = os.environ["ZOOKEEPER_CONF_DIR"] hdp_root = os.environ["HADOOP_NODE_INSTALL_ROOT"] zk_user = "******" # notused zk_log_dir = config['configurations']['zookeeper-env']['zk_log_dir'] zk_data_dir = ensure_double_backslashes( config['configurations']['zoo.cfg']['dataDir']) tickTime = config['configurations']['zoo.cfg']['tickTime'] initLimit = config['configurations']['zoo.cfg']['initLimit'] syncLimit = config['configurations']['zoo.cfg']['syncLimit'] clientPort = config['configurations']['zoo.cfg']['clientPort'] if 'zoo.cfg' in config['configurations']: zoo_cfg_properties_map = config['configurations']['zoo.cfg'].copy() # Fix the data dir - ZK won't start unless the backslashes are doubled zoo_cfg_properties_map['dataDir'] = zk_data_dir else: zoo_cfg_properties_map = {} zoo_cfg_properties_map_length = len(zoo_cfg_properties_map) zookeeper_hosts = config['clusterHostInfo']['zookeeper_hosts'] zookeeper_hosts.sort()
""" from ambari_commons.str_utils import ensure_double_backslashes from resource_management import * # server configurations config = Script.get_config() # notused zookeeper_home_dir = os.environ["ZOOKEEPER_HOME"] zookeeper_conf_dir = os.environ["ZOOKEEPER_CONF_DIR"] hdp_root = os.environ["HADOOP_NODE_INSTALL_ROOT"] zk_user = "******" # notused zk_log_dir = config['configurations']['zookeeper-env']['zk_log_dir'] zk_data_dir = ensure_double_backslashes(config['configurations']['zoo.cfg']['dataDir']) tickTime = config['configurations']['zoo.cfg']['tickTime'] initLimit = config['configurations']['zoo.cfg']['initLimit'] syncLimit = config['configurations']['zoo.cfg']['syncLimit'] clientPort = config['configurations']['zoo.cfg']['clientPort'] if 'zoo.cfg' in config['configurations']: zoo_cfg_properties_map = config['configurations']['zoo.cfg'].copy() # Fix the data dir - ZK won't start unless the backslashes are doubled zoo_cfg_properties_map['dataDir'] = zk_data_dir else: zoo_cfg_properties_map = {} zoo_cfg_properties_map_length = len(zoo_cfg_properties_map) zookeeper_hosts = config['clusterHostInfo']['zookeeper_hosts'] zookeeper_hosts.sort()