def upgrade(new_rpm_path, local_config_dir=None, overwrite=False): """ Copy and upgrade a new presto-server rpm to all of the nodes in the cluster. Retains existing node configuration. The existing topology information is read from the config.json file. Unlike install, there is no provision to supply topology information interactively. The existing cluster configuration is collected from the nodes on the cluster and stored on the host running presto-admin. After the presto-server packages have been upgraded, presto-admin pushes the collected configuration back out to the hosts on the cluster. Note that the configuration files in /etc/opt/prestoadmin are not updated during upgrade. :param new_rpm_path - The path to the new Presto RPM to install :param local_config_dir - (optional) Directory to store the cluster configuration in. If not specified, a temp directory is used. :param overwrite - (optional) if set to True then existing configuration will be orerwriten. :param --nodeps - (optional) Flag to indicate if server upgrade should ignore checking Presto rpm package dependencies. Equivalent to adding --nodeps flag to rpm -U. """ stop() if not local_config_dir: local_config_dir = mkdtemp() print('Saving cluster configuration to %s' % local_config_dir) configure_cmds.gather_directory(local_config_dir, overwrite) filenames = connector.gather_connectors(local_config_dir, overwrite) package.deploy_upgrade(new_rpm_path) configure_cmds.deploy_all(local_config_dir) connector.deploy_files(filenames, os.path.join(local_config_dir, env.host, 'catalog'), constants.REMOTE_CATALOG_DIR, PRESTO_STANDALONE_USER_GROUP)
def upgrade(new_rpm_path, local_config_dir=None, overwrite=False): """ Copy and upgrade a new presto-server rpm to all of the nodes in the cluster. Retains existing node configuration. The existing topology information is read from the config.json file. Unlike install, there is no provision to supply topology information interactively. The existing cluster configuration is collected from the nodes on the cluster and stored on the host running presto-admin. After the presto-server packages have been upgraded, presto-admin pushes the collected configuration back out to the hosts on the cluster. Note that the configuration files in /etc/opt/prestoadmin are not updated during upgrade. :param new_rpm_path - The path to the new Presto RPM to install :param local_config_dir - (optional) Directory to store the cluster configuration in. If not specified, a temp directory is used. :param overwrite - (optional) if set to True then existing configuration will be orerwriten. :param --nodeps - (optional) Flag to indicate if server upgrade should ignore checking Presto rpm package dependencies. Equivalent to adding --nodeps flag to rpm -U. """ stop() if not local_config_dir: local_config_dir = mkdtemp() print('Saving cluster configuration to %s' % local_config_dir) configure_cmds.gather_directory(local_config_dir, overwrite) filenames = connector.gather_connectors(local_config_dir, overwrite) package.deploy_upgrade(new_rpm_path) configure_cmds.deploy_all(local_config_dir) connector.deploy_files( filenames, os.path.join(local_config_dir, env.host, 'catalog'), constants.REMOTE_CATALOG_DIR, PRESTO_STANDALONE_USER_GROUP)
def upgrade(local_package_path, local_config_dir=None): """ Copy and upgrade a new presto-server rpm to all of the nodes in the cluster. Retains existing node configuration. The existing topology information is read from the config.json file. Unlike install, there is no provision to supply topology information interactively. The existing cluster configuration is collected from the nodes on the cluster and stored on the host running presto-admin. After the presto-server packages have been upgraded, presto-admin pushes the collected configuration back out to the hosts on the cluster. Note that the configuration files in /etc/opt/prestoadmin are not updated during upgrade. :param local_package_path - Absolute path to the presto rpm to be installed :param local_config_dir - (optional) Directory to store the cluster configuration in. If not specified, a temp directory is used. """ stop() if not local_config_dir: local_config_dir = mkdtemp() print('Saving cluster configuration to %s' % local_config_dir) configure_cmds.gather_directory(local_config_dir) filenames = connector.gather_connectors(local_config_dir) package.deploy_upgrade(local_package_path) configure_cmds.deploy_all(local_config_dir) connector.deploy_files( filenames, os.path.join(local_config_dir, env.host, 'catalog'), constants.REMOTE_CATALOG_DIR )
def upgrade(local_package_path, local_config_dir=None): """ Copy and upgrade a new presto-server rpm to all of the nodes in the cluster. Retains existing node configuration. The existing topology information is read from the config.json file. Unlike install, there is no provision to supply topology information interactively. The existing cluster configuration is collected from the nodes on the cluster and stored on the host running presto-admin. After the presto-server packages have been upgraded, presto-admin pushes the collected configuration back out to the hosts on the cluster. Note that the configuration files in /etc/opt/prestoadmin are not updated during upgrade. :param local_package_path - Absolute path to the presto rpm to be installed :param local_config_dir - (optional) Directory to store the cluster configuration in. If not specified, a temp directory is used. """ stop() if not local_config_dir: local_config_dir = mkdtemp() print('Saving cluster configuration to %s' % local_config_dir) configure_cmds.gather_directory(local_config_dir) filenames = connector.gather_connectors(local_config_dir) package.deploy_upgrade(local_package_path) configure_cmds.deploy_all(local_config_dir) connector.deploy_files(filenames, os.path.join(local_config_dir, env.host, 'catalog'), constants.REMOTE_CATALOG_DIR)