Przeglądaj źródła

AMBARI-10611 Ensure Accumulo client conf is in sync with accumulo-site conf (billie)

Billie Rinaldi 10 lat temu
rodzic
commit
7113ce2280

+ 24 - 0
ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/client.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<configuration>
+</configuration>

+ 5 - 0
ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/metainfo.xml

@@ -125,6 +125,11 @@
               <fileName>log4j.properties</fileName>
               <dictionaryName>accumulo-log4j</dictionaryName>
             </configFile>
+            <configFile>
+              <type>properties</type>
+              <fileName>client.conf</fileName>
+              <dictionaryName>client</dictionaryName>
+            </configFile>
           </configFiles>
         </component>
       </components>

+ 17 - 2
ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_configuration.py

@@ -105,10 +105,21 @@ def setup_conf_dir(name=None): # 'master' or 'tserver' or 'monitor' or 'gc' or '
 
   # create client.conf file
   configs = {}
+  if 'client' in params.config['configurations']:
+    configs.update(params.config['configurations']['client'])
   configs["instance.name"] = params.instance_name
   configs["instance.zookeeper.host"] = params.config['configurations']['accumulo-site']['instance.zookeeper.host']
-  if 'instance.rpc.sasl.enabled' in params.config['configurations']['accumulo-site']:
-    configs["instance.rpc.sasl.enabled"] = params.config['configurations']['accumulo-site']['instance.rpc.sasl.enabled']
+  copy_site_property(configs, 'instance.rpc.sasl.enabled')
+  copy_site_property(configs, 'rpc.sasl.qop')
+  copy_site_property(configs, 'rpc.useJsse')
+  copy_site_property(configs, 'instance.rpc.ssl.clientAuth')
+  copy_site_property(configs, 'instance.rpc.ssl.enabled')
+  copy_site_property(configs, 'instance.zookeeper.timeout')
+  copy_site_property(configs, 'trace.span.receivers')
+  copy_site_property(configs, 'trace.zookeeper.path')
+  for key,value in params.config['configurations']['accumulo-site'].iteritems():
+    if key.startswith("trace.span.receiver."):
+      configs[key] = value
   PropertiesFile(format("{dest_conf_dir}/client.conf"),
                  properties = configs,
                  owner = params.accumulo_user,
@@ -277,6 +288,10 @@ def setup_conf_dir(name=None): # 'master' or 'tserver' or 'monitor' or 'gc' or '
       try_remove(rpassfile)
       try_remove(cmdfile)
 
+def copy_site_property(configs, name):
+  import params
+  if name in params.config['configurations']['accumulo-site']:
+    configs[name] = params.config['configurations']['accumulo-site'][name]
 
 def create_user(user, password):
   import params