From 20d3568969007f21c3c22e3cc64e64924158fc59 Mon Sep 17 00:00:00 2001 From: Mike Miller Date: Nov 02 2016 19:32:25 +0000 Subject: Fix for Shell erroneously reading accumulo-site.xml --- diff --git a/accumulo.spec b/accumulo.spec index 619db85..550b193 100644 --- a/accumulo.spec +++ b/accumulo.spec @@ -9,7 +9,7 @@ Name: %{proj} Version: 1.6.6 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A software platform for processing vast amounts of data License: ASL 2.0 Group: Development/Libraries @@ -49,6 +49,8 @@ Patch6: ACCUMULO-3470.patch # disable missing vfs2 provider for HDFS (bz#1387110) Patch7: disable-hdfs-vfs2-provider.patch %endif +# Fix for Shell erroneously reading accumulo-site.xml +Patch8: shell-not-read-conf.patch BuildRequires: apache-commons-cli BuildRequires: apache-commons-codec @@ -529,6 +531,9 @@ getent passwd %{name} >/dev/null || /usr/sbin/useradd --comment "%{longproj}" -- %endif %changelog +* Wed Nov 02 2016 Mike Miller - 1.6.6-7 +- Fix for Shell erroneously reading accumulo-site.xml + * Fri Oct 28 2016 Christopher Tubbs - 1.6.6-6 - fix classpath (bz#1389325) and log to console diff --git a/shell-not-read-conf.patch b/shell-not-read-conf.patch new file mode 100644 index 0000000..6274509 --- /dev/null +++ b/shell-not-read-conf.patch @@ -0,0 +1,40 @@ +diff --git a/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java b/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java +index 9231c78..233fbae 100644 +--- a/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java ++++ b/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java +@@ -60,7 +60,6 @@ import org.apache.accumulo.core.client.security.tokens.PasswordToken; + import org.apache.accumulo.core.conf.AccumuloConfiguration; + import org.apache.accumulo.core.conf.DefaultConfiguration; + import org.apache.accumulo.core.conf.Property; +-import org.apache.accumulo.core.conf.SiteConfiguration; + import org.apache.accumulo.core.data.Key; + import org.apache.accumulo.core.data.Value; + import org.apache.accumulo.core.data.thrift.TConstraintViolationSummary; +@@ -463,7 +462,8 @@ public class Shell extends ShellOptions { + if (instanceName == null) { + instanceName = clientConfig.get(ClientProperty.INSTANCE_NAME); + } +- AccumuloConfiguration conf = SiteConfiguration.getInstance(ServerConfigurationUtil.convertClientConfig(DefaultConfiguration.getInstance(), clientConfig)); ++ // use ClientConfig since it should have everything we need ++ AccumuloConfiguration conf = ServerConfigurationUtil.convertClientConfig(DefaultConfiguration.getInstance(), clientConfig); + String keepers = getZooKeepers(keepersOption, clientConfig, conf); + if (instanceName == null) { + Path instanceDir = new Path(VolumeConfiguration.getVolumeUris(conf)[0], "instance_id"); +diff --git a/core/src/main/java/org/apache/accumulo/core/util/shell/ShellOptionsJC.java b/core/src/main/java/org/apache/accumulo/core/util/shell/ShellOptionsJC.java +index 2045eba..1b44a00 100644 +--- a/core/src/main/java/org/apache/accumulo/core/util/shell/ShellOptionsJC.java ++++ b/core/src/main/java/org/apache/accumulo/core/util/shell/ShellOptionsJC.java +@@ -280,6 +280,13 @@ public class ShellOptionsJC { + if (useSsl()) { + clientConfig.setProperty(ClientProperty.INSTANCE_RPC_SSL_ENABLED, "true"); + } ++ if (getZooKeeperInstance().size() > 0) { ++ List zkOpts = getZooKeeperInstance(); ++ String instanceName = zkOpts.get(0); ++ String hosts = zkOpts.get(1); ++ clientConfig.setProperty(ClientProperty.INSTANCE_ZK_HOST, hosts); ++ clientConfig.setProperty(ClientProperty.INSTANCE_NAME, instanceName); ++ } + + // Automatically try to add in the proper ZK from accumulo-site for backwards compat. + if (!clientConfig.containsKey(ClientProperty.INSTANCE_ZK_HOST.getKey())) {