-
Notifications
You must be signed in to change notification settings - Fork 39
GettingStarted
This guide will walk you through the steps to setup a simple instance of Newts running on a single node.
If you are using Newts as part of a solution embedded into another project i.e. OpenNMS you should consult the associated documentation as some of these steps may not be required.
Contents
- Java 8 (OpenJDK, Oracle, etc)
- curl
- tar
- sed
This section assumes that you're setting up a single, local instance of Cassandra for purposes of evaluating Newts. These steps are not suitable for a production Cassandra cluster, (see the Cassandra Getting Started Guide for help with that). If you already have a running cluster, you can skip this section.
Open a new terminal and:
Substitute ${version}
below with the version of Cassandra to download. The
latest 3.0.x version of Cassandra is recommended (version 3.0.6 at the time of
this writing).
# Terminal 1
version=3.0.6
curl http://www.apache.org/dist/cassandra/${version}/apache-cassandra-{${version}}-bin.tar.gz -o "apache-cassandra-#1-bin.tar.gz"
tar zxvf apache-cassandra-${version}-bin.tar.gz
cd apache-cassandra-${version}/
# Terminal 1
bin/cassandra -f
Open a new terminal and:
The latest stable release can be downloaded from Github.
# Terminal 2
curl -L https://github.com/OpenNMS/newts/releases/download/1.4.3/newts-1.4.3-bin.tar.gz -o newts-1.4.3-bin.tar.gz
tar xvf newts-1.4.3-bin.tar.gz
cd newts-1.4.3
The default Newts config (etc/config.yaml
) will connect to localhost at the
default port and keyspace, but if you're using your own install of Cassandra
then you'll need to edit it accordingly.
To perform a one-time initialization of Newts, and create the Cassandra schema
# Terminal 2
bin/init etc/config.yaml
Note: During initialization, SLF4J may complain about logger implementations, you can safely ignore this.
# Terminal 2
bin/newts -c etc/config.yaml
Note: During Newts server startup, you may see warnings about missing compression libraries from the Cassandra driver, you can safely ignore these.
Open a new terminal and:
Next, we'll download some sample data in the JSON representation that Newts
expects, and import them using curl
as a quick test that everything is
working.
# Terminal 3
curl https://raw.githubusercontent.com/OpenNMS/newts/master/rest/samples.txt -o samples.txt
curl -D - -X POST -H "Content-Type: application/json" -d @samples.txt http://0.0.0.0:8080/samples
Finally, we should be able to read back some of the samples inserted above.
# Terminal 3
curl -D - -X GET 'http://0.0.0.0:8080/samples/localhost:chassis:temps?start=1998-07-09T12:05:00-0500&end=1998-07-09T13:15:00-0500'; echo
New in 1.1, is a simple web interface. While too simplistic for most serious applications, the web UI is a handy means of verifying that everything works. Point your browser at http://localhost:8080/ui/, click Debug to insert some random sample data, and then Search to locate and graph it.
Why not try the Global Summary of Day (weather data) demo?
- Getting Started
- Data Model
- Running a REST Service
- Using the Java API
- Aggregation
- Search
- API Reference * Java * REST
- Hacking Newts