Пример #1
0
extern mysql_db_info_t *create_mysql_db_info(slurm_mysql_plugin_type_t type)
{
	mysql_db_info_t *db_info = xmalloc(sizeof(mysql_db_info_t));

	switch (type) {
	case SLURM_MYSQL_PLUGIN_AS:
		db_info->port = slurm_get_accounting_storage_port();
		if (!db_info->port) {
			db_info->port = DEFAULT_MYSQL_PORT;
			slurm_set_accounting_storage_port(db_info->port);
		}
		db_info->host = slurm_get_accounting_storage_host();
		db_info->backup = slurm_get_accounting_storage_backup_host();
		db_info->user = slurm_get_accounting_storage_user();
		db_info->pass = slurm_get_accounting_storage_pass();
		break;
	case SLURM_MYSQL_PLUGIN_JC:
		db_info->port = slurm_get_jobcomp_port();
		if (!db_info->port) {
			db_info->port = DEFAULT_MYSQL_PORT;
			slurm_set_jobcomp_port(db_info->port);
		}
		db_info->host = slurm_get_jobcomp_host();
		db_info->user = slurm_get_jobcomp_user();
		db_info->pass = slurm_get_jobcomp_pass();
		break;
	default:
		xfree(db_info);
		fatal("Unknown mysql_db_info %d", type);
	}
	return db_info;
}
Пример #2
0
static pgsql_db_info_t *_pgsql_jobcomp_create_db_info()
{
	pgsql_db_info_t *db_info = xmalloc(sizeof(pgsql_db_info_t));
	db_info->port = slurm_get_jobcomp_port();
	/* it turns out it is better if using defaults to let postgres
	   handle them on it's own terms */
	if(!db_info->port) {
		db_info->port = DEFAULT_PGSQL_PORT;
		slurm_set_jobcomp_port(db_info->port);
	}
	db_info->host = slurm_get_jobcomp_host();
	db_info->user = slurm_get_jobcomp_user();
	db_info->pass = slurm_get_jobcomp_pass();
	return db_info;
}