Skip to content

Commit

Permalink
Installation instructions have been updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
nuald committed Dec 10, 2020
1 parent 92632a7 commit ff30eda
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,31 @@ Please install:

- [Eclipse Mosquitto](https://mosquitto.org/) MQTT broker
- [Apache Cassandra](http://cassandra.apache.org/) NoSQL database
- [Python 2](https://www.python.org/), required by Cassandra
- [Redis](https://redis.io/) in-memory data store
- [SBT](http://www.scala-sbt.org/) build tool

**Linux** Please use the package manager shipped with the distribution.
For example, you may use pacman for ArchLinux (please note that Cassandra requires Java 8):

$ pacman -S --needed mosquitto redis sbt python2
$ git clone https://aur.archlinux.org/cassandra.git
$ cd cassandra
$ makepkg -si
$ archlinux-java set java-8-openjdk/jre

Optionally you may install:

- [Graphviz](http://www.graphviz.org/) visualization software (its dot utility is used for
the Decision Tree visualization in the sample REPL session)
- [Hey](https://github.com/rakyll/hey) HTTP load generator (used for the performance tests)
- [Scala](https://www.scala-lang.org/download/) shell (used for [the helper script](start.sc) for clustering)

**Linux** Please use the package manager shipped with the distribution.
For example, you may use pacman for ArchLinux:

$ pacman -S --needed graphviz hey scala

### Cluster client requirements

The cluster clients only use Scala shell and SBT (and Git to clone the source codes).
Expand Down Expand Up @@ -92,18 +107,18 @@ Run the spec-based unit tests to ensure that the code works correctly:

$ sbt test

Configure the Cassandra data store:

$ cqlsh -f resources/cassandra/schema.sql

*NOTE: For dropping the keyspace please use: `$ cqlsh -e "drop keyspace sandbox;"`.*

Run the servers:

$ mosquitto
$ cassandra -f
$ redis-server

Configure a Cassandra data store:

$ cqlsh -f resources/cassandra/schema.sql

*NOTE: For dropping the keyspace please use: `$ cqlsh -e "drop keyspace sandbox;"`.*

Run the system (for the convenience, all microservices are packaged into the one system):

$ sbt run
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ object Main extends App {
val session = CqlSession.builder()
.addContactPoint(new InetSocketAddress(contactPoint, 9042))
.withKeyspace(conf.cassandra.keyspace)
.withLocalDatacenter("datacenter1")
.build()
try {
val clusterName = session.getMetadata.getClusterName
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/analyzer/Trainer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Trainer(cassandraClient: CassandraClient, redisClient: RedisClient)
DataTypes.struct(
new StructField("value", DataTypes.DoubleType),
new StructField("anomaly", DataTypes.IntegerType))))
.asJava)
.asJava)
val formula = "anomaly" ~ "value"

// Fit the model
Expand Down

0 comments on commit ff30eda

Please sign in to comment.