Skip to content
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.

Commit

Permalink
[CROSSDATA-577] [SERVER] Service Discovery (#643)
Browse files Browse the repository at this point in the history
* [CROSSDATA] [CONFIG] Service discovery for Hazelcast & Akka members
  • Loading branch information
mafernandez-stratio committed Sep 9, 2016
1 parent f9305b8 commit 275e886
Show file tree
Hide file tree
Showing 12 changed files with 405 additions and 31 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Only listing significant user-visible, not internal code cleanups and minor bug
* Adds support for sub documents at Native side.

* Major Akka version upgrade to 2.4 (2.4.9), thus enabling putting the server behind HAProxy.
* Resolve queries using fully qualified identifiers.
* Resolve queries using fully qualified identifiers.
* Service discovery of Akka Cluster and Hazelcast members for servers through Zookeeper.

## 1.5.0 (August 2016)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ class XDContext protected (@transient val sc: SparkContext,

catalogConfig = Try(xdConfig.getConfig(CoreConfig.CatalogConfigKey)).getOrElse(ConfigFactory.empty())


override protected[sql] def executeSql(sql: String): org.apache.spark.sql.execution.QueryExecution = executePlan(parseSql(sql))

override protected[sql] def executePlan(plan: LogicalPlan): sparkexecution.QueryExecution =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ private[crossdata] case class CreateEphemeralTable(tableIdent: TableIdentifier,

}




private[crossdata] case class DropEphemeralTable(tableIdent: TableIdentifier)
extends LogicalPlan with RunnableCommand {

Expand Down
15 changes: 15 additions & 0 deletions dist/src/main/resources/server/server-application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,21 @@ crossdata-server.config.spark.metrics.conf="/etc/sds/crossdata/server/xdmetrics.
################################
#crossdata-server.akka.cluster.auto-down-unreachable-after = 10s

################################
# #
# Service Discovery #
# #
################################

#crossdata-server.service-discovery.activated = false
#crossdata-server.service-discovery.url = "127.0.0.1:2181"
#crossdata-server.service-discovery.cluster-subscription.path = "/stratio/crossdata/discovery/subscription/leader"
#crossdata-server.service-discovery.cluster-subscription.timeout = 10
#crossdata-server.service-discovery.cluster-leader.path = "/stratio/crossdata/discovery/cluster/leader"
#crossdata-server.service-discovery.cluster-leader.scheduler.delay = 10
#crossdata-server.service-discovery.seeds.path = "/stratio/crossdata/discovery/seeds"
#crossdata-server.service-discovery.provider.path = "/stratio/crossdata/discovery/provider/members"

################################
# #
# Security #
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@
<derby.version>10.10.1.1</derby.version>
<jackson4s.version>3.2.10</jackson4s.version>
<mockito.version>1.10.19</mockito.version>
<curator.version>2.9.0</curator.version>
<common.utils.version>0.5.0</common.utils.version>
<guava.version>18.0</guava.version>
<curator.version>2.11.0</curator.version>
<!-- Scala version and cross build properties -->
<scala.binary.version>2.11</scala.binary.version>
<scala.version>2.11.8</scala.version>
Expand Down
10 changes: 10 additions & 0 deletions server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@
<artifactId>hazelcast</artifactId>
<version>${hazelcast.version}</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
<version>${curator.version}</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-x-discovery</artifactId>
<version>${curator.version}</version>
</dependency>
<!-- TESTS -->
<dependency>
<groupId>com.stratio.crossdata</groupId>
Expand Down
25 changes: 25 additions & 0 deletions server/src/main/resources/server-reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,31 @@ crossdata-server.akka.cluster.acceptable-heartbeat-pause = 20s
crossdata-server.akka.cluster.heartbeat-interval = 6s

crossdata-server.akka.http.server.parsing.max-content-length=1024m

################################
# #
# Service Discovery #
# #
################################

crossdata-server.service-discovery.activated = false
crossdata-server.service-discovery.activated = ${?CROSSDATA_SERVER_SERVICE_DISCOVERY_ACTIVATED}
#crossdata-server.service-discovery.url = "127.0.0.1:2181"
crossdata-server.service-discovery.url = ${?CROSSDATA_SERVER_SERVICE_DISCOVERY_URL}
#crossdata-server.service-discovery.cluster-subscription.path = "/stratio/crossdata/discovery/subscription/leader"
crossdata-server.service-discovery.cluster-subscription.path = ${?CROSSDATA_SERVER_SERVICE_DISCOVERY_CLUSTER_SUBSCRIPTION_PATH}
#crossdata-server.service-discovery.cluster-subscription.timeout = 10
crossdata-server.service-discovery.cluster-subscription.timeout = ${?CROSSDATA_SERVER_SERVICE_DISCOVERY_CLUSTER_SUBSCRIPTION_TIMEOUT}
#crossdata-server.service-discovery.cluster-leader.path = "/stratio/crossdata/discovery/cluster/leader"
crossdata-server.service-discovery.cluster-leader.path = ${?CROSSDATA_SERVER_SERVICE_DISCOVERY_CLUSTER_LEADER_PATH}
#crossdata-server.service-discovery.cluster-leader.scheduler.delay = 10
crossdata-server.service-discovery.cluster-leader.scheduler.delay = ${?CROSSDATA_SERVER_SERVICE_DISCOVERY_CLUSTER_LEADER_DELAY}
#crossdata-server.service-discovery.seeds.path = "/stratio/crossdata/discovery/seeds"
crossdata-server.service-discovery.seeds.path = ${?CROSSDATA_SERVER_SERVICE_DISCOVERY_SEEDS_PATH}
#crossdata-server.service-discovery.provider.path = "/stratio/crossdata/discovery/provider/members"
crossdata-server.service-discovery.provider.path = ${?CROSSDATA_SERVER_SERVICE_DISCOVERY_PROVIDER_PATH}


################################
# #
# Security #
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,25 @@
*/
package com.stratio.crossdata.server

import com.typesafe.config.{Config, ConfigFactory}

import scala.collection.JavaConversions._


object CrossdataApplication extends App {

val crossdataServer = new CrossdataServer
val mapConfig = {
val (keys, values) = args.toList.partition(_.startsWith("--"))
val argsConfig = keys.map(_.replace("--", "")).zip(values).toMap
ConfigFactory.parseMap(argsConfig)
}

val params = mapConfig match {
case m: Config if !m.isEmpty => Some(m)
case _ => None
}

val crossdataServer = new CrossdataServer(params)
crossdataServer.start()

}
Loading

0 comments on commit 275e886

Please sign in to comment.