You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ol...@apache.org on 2018/05/25 16:48:09 UTC

[ambari] branch trunk updated (1af8731 -> a7a2bd7)

This is an automated email from the ASF dual-hosted git repository.

oleewere pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git.


    from 1af8731  AMBARI-23951 Selection information disappears when a filter is applied. (ababiichuk)
     new a7af9d7  AMBARI-23945. Migration Config generator: add backup base path options
     new a7a2bd7  AMBARI-23945. Migration Config generator: add zk details

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/python/migrationConfigGenerator.py    | 30 +++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

-- 
To stop receiving notification emails like this one, please contact
oleewere@apache.org.

[ambari] 01/02: AMBARI-23945. Migration Config generator: add backup base path options

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

oleewere pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git

commit a7af9d7ec827e14c6f354dcbd62c57c2252dde70
Author: Oliver Szabo <ol...@gmail.com>
AuthorDate: Fri May 25 18:16:19 2018 +0200

    AMBARI-23945. Migration Config generator: add backup base path options
---
 .../src/main/python/migrationConfigGenerator.py     | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/ambari-infra/ambari-infra-solr-client/src/main/python/migrationConfigGenerator.py b/ambari-infra/ambari-infra-solr-client/src/main/python/migrationConfigGenerator.py
index c11629e..570f4ae 100755
--- a/ambari-infra/ambari-infra-solr-client/src/main/python/migrationConfigGenerator.py
+++ b/ambari-infra/ambari-infra-solr-client/src/main/python/migrationConfigGenerator.py
@@ -99,7 +99,7 @@ def get_random_solr_url(solr_urls):
   logger.debug("Use {0} for request ...".format(result))
   return result
 
-def retry (func, *args, **kwargs):
+def retry(func, *args, **kwargs):
   retry_count = kwargs.pop("count", 10)
   delay = kwargs.pop("delay", 5)
   context = kwargs.pop("context", "")
@@ -336,6 +336,14 @@ def generate_ambari_solr_migration_ini_file(options, accessor, protocol):
         config.set('ranger_collection', 'backup_ranger_config_set', 'old_ranger_audits')
         config.set('ranger_collection', 'backup_ranger_collection_name', 'old_ranger_audits')
         print 'Ranger Solr collection: ' + ranger_collection_name
+        ranger_backup_path = None
+        if options.backup_base_path:
+          ranger_backup_path = "{0}/ranger".format(options.backup_base_path)
+        elif options.backup_ranger_base_path:
+          ranger_backup_path = options.backup_ranger_base_path
+        if ranger_backup_path is not None:
+          config.set('ranger_collection', 'backup_path', ranger_backup_path)
+          print 'Ranger backup path: ' + ranger_backup_path
     else:
       config.set('ranger_collection', 'enabled', 'false')
   else:
@@ -364,6 +372,14 @@ def generate_ambari_solr_migration_ini_file(options, accessor, protocol):
     if 'vertex_index' in max_shards_map:
       config.set('atlas_collections', 'vertex_index_max_shards_per_node', max_shards_map['vertex_index'])
     print 'Atlas Solr collections: fulltext_index, edge_index, vertex_index'
+    atlas_backup_path = None
+    if options.backup_base_path:
+      atlas_backup_path = "{0}/atlas".format(options.backup_base_path)
+    elif options.backup_ranger_base_path:
+      atlas_backup_path = options.backup_atlas_base_path
+    if atlas_backup_path is not None:
+      config.set('atlas_collections', 'backup_path', atlas_backup_path)
+      print 'Atlas backup path: ' + atlas_backup_path
   else:
     config.set('atlas_collections', 'enabled', 'false')
 
@@ -425,6 +441,9 @@ if __name__=="__main__":
     parser.add_option("-p", "--password", dest="password", type="string", help="password for accessing ambari server")
     parser.add_option("-j", "--java-home", dest="java_home", type="string", help="local java_home location")
     parser.add_option("-i", "--ini-file", dest="ini_file", default="ambari_solr_migration.ini", type="string", help="Filename of the generated ini file for migration (default: ambari_solr_migration.ini)")
+    parser.add_option("--backup-base-path", dest="backup_base_path", default=None, type="string", help="base path for backup, e.g.: /tmp/backup, then /tmp/backup/ranger/ and /tmp/backup/atlas/ folders will be generated")
+    parser.add_option("--backup-ranger-base-path", dest="backup_ranger_base_path", default=None, type="string", help="base path for ranger backup, e.g.: /tmp/backup/ranger")
+    parser.add_option("--backup-atlas-base-path", dest="backup_atlas_base_path", default=None, type="string", help="base path for backup, e.g.: /tmp/backup/atlas")
     parser.add_option("--skip-atlas", dest="skip_atlas", action="store_true", default=False, help="skip to gather Atlas service details")
     parser.add_option("--skip-ranger", dest="skip_ranger", action="store_true", default=False, help="skip to gather Ranger service details")
     parser.add_option("--retry", dest="retry", type="int", default=10, help="number of retries during accessing random solr urls")

-- 
To stop receiving notification emails like this one, please contact
oleewere@apache.org.

[ambari] 02/02: AMBARI-23945. Migration Config generator: add zk details

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

oleewere pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git

commit a7a2bd7cd0417eff5809c7f2fadbf31260d25a74
Author: Oliver Szabo <ol...@gmail.com>
AuthorDate: Fri May 25 18:45:06 2018 +0200

    AMBARI-23945. Migration Config generator: add zk details
---
 .../src/main/python/migrationConfigGenerator.py                  | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ambari-infra/ambari-infra-solr-client/src/main/python/migrationConfigGenerator.py b/ambari-infra/ambari-infra-solr-client/src/main/python/migrationConfigGenerator.py
index 570f4ae..51d92be 100755
--- a/ambari-infra/ambari-infra-solr-client/src/main/python/migrationConfigGenerator.py
+++ b/ambari-infra/ambari-infra-solr-client/src/main/python/migrationConfigGenerator.py
@@ -311,6 +311,15 @@ def generate_ambari_solr_migration_ini_file(options, accessor, protocol):
   if security_enabled == 'true':
     config.set('infra_solr', 'keytab', infra_solr_kerberos_keytab)
     config.set('infra_solr', 'principal', infra_solr_kerberos_principal)
+    zookeeper_env_props = get_config_props(cluster_config, 'zookeeper-env')
+    zookeeper_principal_name = zookeeper_env_props['zookeeper_principal_name'] if 'zookeeper_principal_name' in zookeeper_env_props else "zookeeper/_HOST@EXAMPLE.COM"
+    zk_principal_user = zookeeper_principal_name.split("/")[0]
+    default_zk_quorum = "{zookeeper_quorum}"
+    external_zk_connection_string = infra_solr_env_props['infra_solr_zookeeper_quorum'] if 'infra_solr_zookeeper_quorum' in infra_solr_env_props else default_zk_quorum
+    if default_zk_quorum != external_zk_connection_string:
+      print "Found external zk connection string: {0}".format(external_zk_connection_string)
+      config.set('infra_solr', 'external_zk_connection_string', external_zk_connection_string)
+    config.set('infra_solr', 'zk_principal_user', zk_principal_user)
 
   state_json_map = retry(get_state_json_map, solr_urls, infra_solr_user, security_enabled, infra_solr_kerberos_keytab, infra_solr_kerberos_principal, count=options.retry, delay=options.delay, context="Get clusterstate.json")
   coll_shard_map=get_shard_numbers_per_collections(state_json_map)

-- 
To stop receiving notification emails like this one, please contact
oleewere@apache.org.