Skip to content

Commit c369e2e

Browse files
committed
Merge branch 'master' of https://github.com/cfpb/hmda-platform
2 parents b1eaa2a + 0a73472 commit c369e2e

File tree

9 files changed

+22
-10
lines changed

9 files changed

+22
-10
lines changed

Documents/cluster.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# HMDA Akka Cluster Configuration
2+
3+
## Cluster Management
4+
5+
The project uses the [Akka Cluster HTTP Management](http://developer.lightbend.com/docs/akka-management/current/cluster-http-management.html) module to report on cluster member status as well as to perform cluster
6+
management tasks. Please refer to the documentation of this module for cluster management tasks (i.e. downing a node from the cluster)

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ In addition, you'll need Scala's interactive build tool [sbt](http://www.scala-s
7272

7373
## Building and Running
7474

75-
The HMDA Platform uses sbt's multi-project builds, each project representing a specific task.
75+
The HMDA Platform uses sbt's multi-project builds, each project representing a specific task. The platform is an Akka Cluster
76+
application that can be deployed on a single node or as a distributed application. For more information on how Akka Cluster
77+
is used, see the documentation [here](Documents/cluster.md)
7678

7779
### Interactive
7880

api/src/main/resources/application.conf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ akka {
2323

2424
retry-unsuccessful-join-after = 20s
2525

26-
//DON'T USE IN PRODUCTION!!!!!
27-
auto-down-unreachable-after = 10s
26+
http {
27+
management {
28+
hostname = "127.0.0.1"
29+
port = 9999
30+
}
31+
}
2832

2933
}
3034

api/src/main/scala/hmda/api/HmdaPlatform.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package hmda.api
33
import java.io.File
44

55
import akka.actor._
6+
import akka.cluster.Cluster
7+
import akka.cluster.http.management.ClusterHttpManagement
68
import akka.pattern.ask
79
import akka.util.Timeout
810

@@ -32,6 +34,8 @@ object HmdaPlatform {
3234
def main(args: Array[String]): Unit = {
3335

3436
val system = ActorSystem(configuration.getString("clustering.name"), configuration)
37+
val cluster = Cluster(system)
38+
ClusterHttpManagement(cluster).start()
3539
val supervisor = createSupervisor(system)
3640
val querySupervisor = createQuerySupervisor(system)
3741
implicit val ec = system.dispatchers.lookup("api-dispatcher")

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
66

77
val commonDeps = Seq(logback, scalaTest, scalaCheck)
88

9-
val akkaDeps = commonDeps ++ Seq(akka, akkaCluster, akkaSlf4J, akkaStream, akkaTestkit, constructr, constructrZookeeper)
9+
val akkaDeps = commonDeps ++ Seq(akka, akkaCluster, akkaSlf4J, akkaStream, akkaTestkit, constructr, constructrZookeeper, akkaClusterManagement)
1010

1111
val akkaPersistenceDeps = akkaDeps ++ Seq(akkaPersistence, akkaStream, leveldb, leveldbjni, akkaPersistenceQuery, inMemoryPersistence, cassandraPersistence)
1212

project/Dependencies.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ object Dependencies {
1515
val akkaSlf4J = "com.typesafe.akka" %% "akka-slf4j" % Version.akka
1616
val akka = "com.typesafe.akka" %% "akka-actor" % Version.akka
1717
val akkaCluster = "com.typesafe.akka" %% "akka-cluster" % Version.akka
18+
val akkaClusterManagement = "com.lightbend.akka" %% "akka-management-cluster-http" % Version.akkaClusterManagement
1819
val akkaTestkit = "com.typesafe.akka" %% "akka-testkit" % Version.akka % "test"
1920
val akkaStream = "com.typesafe.akka" %% "akka-stream" % Version.akka
2021
val akkaPersistence = "com.typesafe.akka" %% "akka-persistence" % Version.akka

project/Version.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ object Version {
55
val scalaCheck = "1.13.4"
66
val scalaz = "7.2.9"
77
val akka = "2.4.19"
8+
val akkaClusterManagement = "0.3"
89
val akkaHttp = "10.0.8"
910
val leveldb = "0.7"
1011
val leveldbjni = "1.8"

publication/src/main/resources/application.conf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ akka {
2828

2929
retry-unsuccessful-join-after = 20s
3030

31-
//DON'T USE IN PRODUCTION!!!!!
32-
auto-down-unreachable-after = 10s
33-
3431
}
3532

3633

query/src/main/resources/application.conf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ akka {
2727

2828
retry-unsuccessful-join-after = 20s
2929

30-
//DON'T USE IN PRODUCTION!!!!!
31-
auto-down-unreachable-after = 10s
32-
3330
}
3431
}
3532

0 commit comments

Comments
 (0)