Repository: incubator-atlas Updated Branches: refs/heads/0.7-incubating 6681b9486 -> 4c3a7f3dc
ATLAS-1342 Titan Solrclient - Add timeouts for zookeeper connect and session (sumasai) (cherry picked from commit c91f582a787a6ea88c4b8d2e4828e85f708ce7f0) Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/4c3a7f3d Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/4c3a7f3d Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/4c3a7f3d Branch: refs/heads/0.7-incubating Commit: 4c3a7f3dca19cb297d09a3749a2d57c265b08933 Parents: 6681b94 Author: Suma Shivaprasad <[email protected]> Authored: Tue Dec 6 21:27:35 2016 -0800 Committer: Madhan Neethiraj <[email protected]> Committed: Tue Dec 27 14:48:50 2016 -0800 ---------------------------------------------------------------------- distro/pom.xml | 4 ++++ distro/src/conf/atlas-log4j.xml | 2 +- docs/src/site/twiki/Configuration.twiki | 2 ++ docs/src/site/twiki/InstallationSteps.twiki | 2 ++ .../titan/diskstorage/solr/Solr5Index.java | 15 +++++++++++++++ 5 files changed, 24 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/4c3a7f3d/distro/pom.xml ---------------------------------------------------------------------- diff --git a/distro/pom.xml b/distro/pom.xml index 9d07d4b..f6deb88 100644 --- a/distro/pom.xml +++ b/distro/pom.xml @@ -45,6 +45,8 @@ atlas.graph.storage.lock.wait-time=10000 #Solr cloud mode properties atlas.graph.index.search.solr.mode=cloud atlas.graph.index.search.solr.zookeeper-url= +atlas.graph.index.search.solr.zookeeper-connect-timeout=60000 +atlas.graph.index.search.solr.zookeeper-session-timeout=60000 #Solr http mode properties #atlas.graph.index.search.solr.mode=http @@ -162,6 +164,8 @@ atlas.graph.storage.lock.wait-time=10000 #Solr cloud mode properties atlas.graph.index.search.solr.mode=cloud atlas.graph.index.search.solr.zookeeper-url=localhost:2181 +atlas.graph.index.search.solr.zookeeper-connect-timeout=60000 +atlas.graph.index.search.solr.zookeeper-session-timeout=60000 #Solr http mode properties #atlas.graph.index.search.solr.mode=http http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/4c3a7f3d/distro/src/conf/atlas-log4j.xml ---------------------------------------------------------------------- diff --git a/distro/src/conf/atlas-log4j.xml b/distro/src/conf/atlas-log4j.xml index 400cd3a..b673ba4 100755 --- a/distro/src/conf/atlas-log4j.xml +++ b/distro/src/conf/atlas-log4j.xml @@ -73,7 +73,7 @@ --> <logger name="com.thinkaurelius.titan" additivity="false"> - <level value="warn"/> + <level value="info"/> <appender-ref ref="FILE"/> </logger> http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/4c3a7f3d/docs/src/site/twiki/Configuration.twiki ---------------------------------------------------------------------- diff --git a/docs/src/site/twiki/Configuration.twiki b/docs/src/site/twiki/Configuration.twiki index bbe56d2..957aa38 100644 --- a/docs/src/site/twiki/Configuration.twiki +++ b/docs/src/site/twiki/Configuration.twiki @@ -78,6 +78,8 @@ Please note that Solr installation in Cloud mode is a prerequisite before config atlas.graph.index.search.backend=solr5 atlas.graph.index.search.solr.mode=cloud atlas.graph.index.search.solr.zookeeper-url=<the ZK quorum setup for solr as comma separated value> eg: 10.1.6.4:2181,10.1.6.5:2181 + atlas.graph.index.search.solr.zookeeper-connect-timeout=<SolrCloud Zookeeper Connection Timeout>. Default value is 60000 ms + atlas.graph.index.search.solr.zookeeper-session-timeout=<SolrCloud Zookeeper Session Timeout>. Default value is 60000 ms </verbatim> Also note that if the embedded-hbase-solr profile is used then Solr is included in the distribution so that a standalone http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/4c3a7f3d/docs/src/site/twiki/InstallationSteps.twiki ---------------------------------------------------------------------- diff --git a/docs/src/site/twiki/InstallationSteps.twiki b/docs/src/site/twiki/InstallationSteps.twiki index 4dae7a3..3675265 100644 --- a/docs/src/site/twiki/InstallationSteps.twiki +++ b/docs/src/site/twiki/InstallationSteps.twiki @@ -264,6 +264,8 @@ For configuring Titan to work with Solr, please follow the instructions below atlas.graph.index.search.backend=solr5 atlas.graph.index.search.solr.mode=cloud atlas.graph.index.search.solr.zookeeper-url=<the ZK quorum setup for solr as comma separated value> eg: 10.1.6.4:2181,10.1.6.5:2181 + atlas.graph.index.search.solr.zookeeper-connect-timeout=<SolrCloud Zookeeper Connection Timeout>. Default value is 60000 ms + atlas.graph.index.search.solr.zookeeper-session-timeout=<SolrCloud Zookeeper Session Timeout>. Default value is 60000 ms </verbatim> * Restart Atlas http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/4c3a7f3d/titan/src/main/java/com/thinkaurelius/titan/diskstorage/solr/Solr5Index.java ---------------------------------------------------------------------- diff --git a/titan/src/main/java/com/thinkaurelius/titan/diskstorage/solr/Solr5Index.java b/titan/src/main/java/com/thinkaurelius/titan/diskstorage/solr/Solr5Index.java index 3b5620c..f3b9fd9 100644 --- a/titan/src/main/java/com/thinkaurelius/titan/diskstorage/solr/Solr5Index.java +++ b/titan/src/main/java/com/thinkaurelius/titan/diskstorage/solr/Solr5Index.java @@ -142,6 +142,14 @@ public class Solr5Index implements IndexProvider { "URL of the Zookeeper instance coordinating the SolrCloud cluster", ConfigOption.Type.MASKABLE, "localhost:2181"); + public static final ConfigOption<Integer> ZOOKEEPER_CONNECT_TIMEOUT = new ConfigOption<Integer>(SOLR_NS,"zookeeper-connect-timeout", + "SolrCloud Zookeeper connect timeout", + ConfigOption.Type.MASKABLE, 60000); + + public static final ConfigOption<Integer> ZOOKEEPER_SESSION_TIMEOUT = new ConfigOption<Integer>(SOLR_NS,"zookeeper-session-timeout", + "SolrCloud Zookeeper session timeout", + ConfigOption.Type.MASKABLE, 60000); + public static final ConfigOption<Integer> NUM_SHARDS = new ConfigOption<Integer>(SOLR_NS,"num-shards", "Number of shards for a collection. This applies when creating a new collection which is only supported under the SolrCloud operation mode.", ConfigOption.Type.GLOBAL_OFFLINE, 1); @@ -210,6 +218,13 @@ public class Solr5Index implements IndexProvider { HttpClientUtil.setConfigurer(new Krb5HttpClientConfigurer()); String zookeeperUrl = config.get(Solr5Index.ZOOKEEPER_URL); CloudSolrClient cloudServer = new CloudSolrClient(zookeeperUrl, true); + + logger.info("Zookeeper connect timeout : " + config.get(ZOOKEEPER_CONNECT_TIMEOUT)); + cloudServer.setZkConnectTimeout(config.get(ZOOKEEPER_CONNECT_TIMEOUT)); + + logger.info("Zookeeper session timeout : " + config.get(ZOOKEEPER_SESSION_TIMEOUT)); + cloudServer.setZkClientTimeout(config.get(ZOOKEEPER_SESSION_TIMEOUT)); + cloudServer.connect(); solrClient = cloudServer; } else if (mode==Mode.HTTP) {
