strapdata / gravitee-repository-elassandra

Elassandra gravitee repository for management, ratelimit and analytics
GNU Affero General Public License v3.0
3 stars 0 forks source link

Gravitee Elassandra Repository Build Status

Elassandra repository (Management, Rate Limit and Analytics), with the following benefits:

Gravitee Elassandra architecture

This repository uses Datastax Java driver for communication with Cassandra and Elasticsearch query over CQL.

Requirement

The minimum requirement is :

In order to use Gravitee snapshot, You need to declare the following repository in you Maven settings :

https://oss.sonatype.org/content/repositories/snapshots

Building

This Elassandra repository use Elassandra-Unit to run gravitee unit tests.

$ git clone https://github.com/strapdata/gravitee-repository-elassandra.git
$ cd gravitee-repository-elassandra
$ mvn clean package

To build the gravitee docker images including this gravitee-repository-elassandra.zip,

build.sh

Strapdata docker images are also available on the Docker Hub:

Installing

Configuration

Configuration settings, prefixed by scope.elassandra, where scope is management or ratelimit:

Parameter Description default
localDc Sets the name of the datacenter that will be considered "local"
contactPoint Allows to connect to Cassandra cluster nodes. It is not necessary to add all contact points because Cassandra driver will use auto-discovery mechanism. localhost
endpoint Defines the Elasticsearch endpoint used to create Elasticsearch indices. http://localhost:9200
port Defines the CQL native transport port 9042
keyspaceName Name of the keyspace. Note that the final will be prefixed with the corresponding scope. gravitee
username Permit to connect to Cassandra and Elasticsearch if using access with credentials. cassandra
password Permit to connect to Cassandra and Elasticsearch if using access with credentials. cassandra
index.prefix Index name prefix (to setup elasticsearch template for indices starting with this prefix)
connectTimeoutMillis Defines how long the driver waits to establish a new connection to a Cassandra node before giving up 5000
readTimeoutMillis Controls how long the driver waits for a response from a given Cassandra node before considering it unresponsive 12000
reconnectDelay Reconnection retry delay in milliseconds 5000
consistencyLevel Sets the level of consistency for read & write access, e.g. ONE, QUORUM, ALL (see Datastax documentation for comprehensive list) LOCAL_QUORUM ssl.provider Java SSL/TLS provider JDK
ssl.truststore.path Truststore file name (JKS or P12)
ssl.truststore.password Truststore password
ssl.keystore.path Keystore file name (JKS or P12) for TLS client authentication
ssl.keystore.password Keystore password

For analytics, settings are the same as Elasticsearch, see the gravitee documentation (Elassandra is seen as a vanilla Elasticsearch).

Configuration sample:

management:
  type: elassandra
  elassandra:
    clusterName: elassandra
    port: 39042
    contactPoint: elassandra.default.svc.cluster.local
    endpoint: https://elassandra-elasticsearch.default.svc.cluster.local:9200
    username: cassandra
    password: cassandra
    ssl:
      truststore:
        path: /ca-pub/truststore.p12
        password: changeit
ratelimit:
  type: elassandra
  elassandra:
    clusterName: elassandra
    port: 39042
    contactPoint: elassandra.default.svc.cluster.local
    endpoint: https://elassandra-elasticsearch.default.svc.cluster.local:9200
    username: cassandra
    password: cassandra
    ssl:
      truststore:
        path: /ca-pub/truststore.p12
        password: changeit
analytics:
  type: elasticsearch
  elasticsearch:
    endpoints:
      - https://elassandra-elasticsearch.default.svc.cluster.local:9200
    security:
      username: cassandra
      password: cassandra
      ssl:
        truststore:
          path: /ca-pub/truststore.p12
          password: changeit
    index: analytics
    cluster: elassandra
...

Support

License

This software is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE.

Acknowledgments