8000 AMBARI-26311: postgresql-server should be installed even though ambari-server is configured with mysql by eubnara · Pull Request #3945 · apache/ambari · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

AMBARI-26311: postgresql-server should be installed even though ambari-server is configured with mysql #3945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion ambari-server/src/main/python/ambari_server/dbCleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@

from ambari_commons.logging_utils import print_info_msg, print_error_msg
from ambari_commons.os_utils import run_os_command
from ambari_server.dbConfiguration import ensure_jdbc_driver_is_installed
from ambari_server.dbConfiguration import (
ensure_jdbc_driver_is_installed,
LINUX_DBMS_KEYS_LIST,
)
from ambari_server.serverConfiguration import (
configDefaults,
get_ambari_properties,
get_java_exe_path,
read_ambari_user,
get_db_type,
parse_properties_file,
JDBC_DATABASE_PROPERTY,
)
from ambari_server.setupSecurity import (
generate_env,
Expand Down Expand Up @@ -106,6 +111,9 @@ def run_db_purge(options):
)
return 1

properties = get_ambari_properties()
parse_properties_file(options)
options.database_index = LINUX_DBMS_KEYS_LIST.index(properties[JDBC_DATABASE_PROPERTY])
Comment on lines +114 to +116
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without these, it tries to execute ensure_jdbc_driver_is_installed() with postgresql even though ambari-server is configured with another RDBMS.

ensure_jdbc_driver_is_installed(options, get_ambari_properties())

server_class_path = ServerClassPath(get_ambari_properties(), options)
Expand Down
8000 484F
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ class PGConfig(LinuxDBMSConfig):
PG_STATUS_STOPPED = "stopped"
PG_SERVICE_NAME = "postgresql"
PG_HBA_DIR = None
PG_INITDB_CMD = None

if (
OSCheck.is_redhat_family()
Expand All @@ -541,8 +542,6 @@ class PGConfig(LinuxDBMSConfig):
if psql_service_file:
psql_service_file_name = os.path.basename(psql_service_file[0])
PG_SERVICE_NAME = psql_service_file_name[:-8] # remove .service
else:
raise FatalException(1, "Cannot find postgresql-setup script.")

SERVICE_CMD = "/usr/bin/env systemctl"
PG_ST_CMD = f"{SERVICE_CMD} status {PG_SERVICE_NAME}"
Expand Down Expand Up @@ -598,6 +597,8 @@ class PGConfig(LinuxDBMSConfig):
)

def __init__(self, options, properties, storage_type):
if PGConfig.PG_INITDB_CMD is None:
raise FatalException(1, "Cannot find postgresql-setup script.")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move FatalException here in order to raise this exception only when __init__ called with createPGConfig().

super(PGConfig, self).__init__(options, properties, storage_type)

# Init the database configuration data here, if any
Expand Down
0