Skip to content

Commit 0d0c520

Browse files
committed
Relocate Management API to K8ssandra org
1 parent df33bd6 commit 0d0c520

File tree

4 files changed

+90
-77
lines changed

4 files changed

+90
-77
lines changed

README.md

+85-72
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,132 @@
1-
# Management API for Apache Cassandra®
1+
# Management API for Apache Cassandra™
22

3-
![Java CI](https://github.com/datastax/management-api-for-apache-cassandra/workflows/Java%20CI/badge.svg)
4-
![Docker Release](https://github.com/datastax/management-api-for-apache-cassandra/workflows/Docker%20Release/badge.svg)
3+
![Java CI](https://github.com/k8ssandra/management-api-for-apache-cassandra/workflows/Java%20CI/badge.svg)
4+
![Docker Release](https://github.com/k8ssandra/management-api-for-apache-cassandra/workflows/Docker%20Release/badge.svg)
55
## Introduction
66

7-
Cassandra® operations have historically been command line driven.
8-
The management of operational tools for Apache Cassandra® have been mostly
9-
outsourced to teams who manage their specific environments.
10-
7+
Cassandra operations have historically been command line driven.
8+
The management of operational tools for Apache Cassandra have been mostly
9+
outsourced to teams who manage their specific environments.
10+
1111
The result is a fragmented and tribal set of best practices, workarounds,
1212
and edge cases.
13-
13+
1414
The Management API is a sidecar service layer that attempts to build a well supported
15-
set of operational actions on Cassandra® nodes that can be administered centrally.
16-
It currently works with official [Apache Cassandra®](https://cassandra.apache.org) 3.11.x an 4.0
15+
set of operational actions on Cassandra nodes that can be administered centrally.
16+
It currently works with official [Apache Cassandra](https://cassandra.apache.org) 3.11.x and 4.0
1717
via a drop in java agent.
18-
19-
* Lifecycle Management
18+
19+
* Lifecycle Management
2020
* Start Node
2121
* Stop Node
2222
* Configuration Management (alpha)
2323
* Change YAML
2424
* Change jvm-opts
25-
* Health Checks
25+
* Health Checks
2626
* Kubernetes liveness/readiness checks
27-
* Consistency level checks
28-
* Per node actions
27+
* Consistency level checks
28+
* Per node actions
2929
* All nodetool commands
30-
30+
3131
## Design Principles
3232
* Secure by default
3333
* Simple to use and extend
3434
* CQL Only for all C* interactions
3535
* Operations: Use `CALL` method for invoking via CQL
36-
* Observations: Rely on System Views
37-
38-
The Management API has no configuration file. Rather, it can only be configured from a
39-
small list of command line flags. Communication by default can only be via **unix socket**
36+
* Observations: Rely on System Views
37+
38+
The Management API has no configuration file. Rather, it can only be configured from a
39+
small list of command line flags. Communication by default can only be via **unix socket**
4040
or via a **http(s) endpoint** with optional TLS client auth.
41-
42-
In a containerized setting the Management API represents **PID 1** and will be
43-
responsible for the lifecycle of Cassandra® via the API.
44-
45-
Communication between the Management API and Cassandra® is via a local **unix socket** using
46-
CQL as it's only protocol. This means, out of the box Cassandra® can be started
41+
42+
In a containerized setting the Management API represents **PID 1** and will be
43+
responsible for the lifecycle of Cassandra via the API.
44+
45+
Communication between the Management API and Cassandra is via a local **unix socket** using
46+
CQL as it's only protocol. This means, out of the box Cassandra can be started
4747
securely with no open ports! Also, using CQL only means operators can
4848
execute operations via CQL directly if they wish.
49-
49+
5050
Each Management API is responsible for the local node only. Coordination across nodes
5151
is up to the caller. That being said, complex health checks can be added via CQL.
52-
52+
5353
## Building
5454

5555
### Containers
56-
57-
First you need to build the Management API base image:
58-
56+
57+
First you need to build the Management API base image
58+
59+
(*Deprecated: For Cassandra 3.11 and 4.0 images, as well as DSE 6.8 images, you do not need to build the Management API builder image*):
60+
5961
docker build -t management-api-for-apache-cassandra-builder -f ./Dockerfile-build .
6062

61-
Then you need to build the image based on the actual Cassandra® version, either the 3.11 or 4.0:
63+
Then you need to build the image based on the actual Cassandra version, either the 3.11 or 4.0:
6264

6365
**NOTE:** For building 3.11 images, you will need to have the [Docker buildx plugin](https://docs.docker.com/buildx/working-with-buildx/) installed.
6466

6567
#Create a docker image with management api and C* 3.11 (version 3.11.7 and newer are supported, replace `3.11.10` with the version you want below)
6668
docker buildx build --load --build-arg CASSANDRA_VERSION=3.11.10 --tag mgmtapi-3_11 --file Dockerfile-oss --target oss311 --platform linux/amd64 .
67-
69+
6870
#Create a docker image with management api and C* 4.0
6971
docker build -t mgmtapi-4_0 -f Dockerfile-4_0 .
7072

71-
You can also build an image based on Datastax Astra Cassandra® 4.0 sources. First checkout [sources](https://github.com/datastax/cassandra/tree/astra) and build a tgz distribution:
72-
73+
You can also build an image based on Datastax Astra Cassandra 4.0 sources. First checkout [sources](https://github.com/datastax/cassandra/tree/astra) and build a tgz distribution:
74+
7375
ant artifacts
74-
76+
7577
Then copy the tgz archive into the astra-4.0 directory of the Management API sources and run:
76-
78+
7779
cd astra-4.0
7880
docker build -t datastax/astra:4.0 .
79-
81+
8082
Finally build the Management API image:
81-
83+
8284
cd ..
8385
docker build -t mgmtapi-astra-4_0 -f Dockerfile-astra-4_0 .
8486

85-
87+
8688
### Standalone
87-
89+
8890
mvn -DskipTests package
8991
mvn test
90-
92+
mvn integration-test -Drun311tests=true -Drun40tests=true
93+
94+
**NOTE 1:** Running ````integration-test````s will also run unit tests.
95+
96+
**NOTE 2:** Running ````integration-test````s requires at least one of ````-Drun311tests````, ````-Drun40tests```` or ````-DrunDSEtests```` to be set to ````true```` (you can set any combination of them to ````true````).
97+
98+
**NOTE 3:** In order to run DSE integration tests, you must also enable the ````dse```` profile:
99+
100+
mvn integration-test -P dse -DrunDSEtests=true
101+
91102
## REST API
92-
[The current Swagger/OpenAPI documentation](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/datastax/management-api-for-apache-cassandra/master/management-api-server/doc/openapi.json&nocors)
93-
103+
[The current Swagger/OpenAPI documentation](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/k8ssandra/management-api-for-apache-cassandra/master/management-api-server/doc/openapi.json&nocors)
104+
94105
Also readable from url root: ````/openapi.json````
95-
106+
96107
## Usage
97108

98109
The latest releases are on Docker Hub:
99-
[Management API for Apache Cassandra® 3.11.7](https://hub.docker.com/repository/docker/datastax/cassandra-mgmtapi-3_11_7) and
100-
[Management API for Apache Cassandra® 4.0 alpha3](https://hub.docker.com/repository/docker/datastax/cassandra-mgmtapi-4_0_0).
101-
110+
111+
- [Management API for Apache Cassandra 3.11.7](https://hub.docker.com/repository/docker/datastax/cassandra-mgmtapi-3_11_7)
112+
- [Management API for Apache Cassandra 3.11.8](https://hub.docker.com/repository/docker/datastax/cassandra-mgmtapi-3_11_8)
113+
- [Management API for Apache Cassandra 3.11.9](https://hub.docker.com/repository/docker/datastax/cassandra-mgmtapi-3_11_9)
114+
- [Management API for Apache Cassandra 3.11.10](https://hub.docker.com/repository/docker/datastax/cassandra-mgmtapi-3_11_10)
115+
- [Management API for Apache Cassandra 4.0-beta4](https://hub.docker.com/repository/docker/datastax/cassandra-mgmtapi-4_0_0).
116+
102117
For running standalone the jars can be downloaded from the github release:
103-
[Management API Releases Zip](https://github.com/datastax/management-api-for-apache-cassandra/releases)
118+
[Management API Releases Zip](https://github.com/k8ssandra/management-api-for-apache-cassandra/releases)
119+
120+
The Management API can be run as a standalone service or along with the Kubernetes
121+
[cass-operator](https://github.com/datastax/cass-operator).
104122

105-
The Management API can be run as a standalone service or along with the Kubernetes
106-
[cass-operator](https://github.com/datastax/cass-operator).
107-
108123
The Management API is configured from the CLI. To start the service with a C* version built above, run:
109-
110-
> docker run -p 8080:8080 -it --rm mgmtapi-4_0
111-
124+
125+
> docker run -p 8080:8080 -it --rm mgmtapi-4_0
126+
112127
> curl http://localhost:8080/api/v0/probes/liveness
113128
OK
114-
129+
115130
# Check service and C* are running
116131
> curl http://localhost:8080/api/v0/probes/readiness
117132
OK
@@ -124,8 +139,6 @@ Once you have DSE jars published locally, follow these steps:
124139
# The builder image needs to have Maven settings.xml (that provides access to Artifactory):
125140
cp $HOME/.m2/settings.xml $PWD
126141
127-
docker build -t management-api-for-dse-builder -f ./Dockerfile-build-dse .
128-
129142
docker build -t mgmtapi-dse -f Dockerfile-dse-68 .
130143
131144
docker run -p 8080:8080 -it --rm mgmtapi-dse
@@ -137,34 +150,34 @@ docker run -p 8080:8080 -it --rm mgmtapi-dse
137150

138151
To start the service with a locally installed C* or DSE instance, you would run the below commands. The Management API will figure out
139152
through `--db-home` whether it points to a C* or DSE folder
140-
153+
141154
# REQUIRED: Add management api agent to C*/DSE startup
142155
> export JVM_EXTRA_OPTS="-javaagent:$PWD/management-api-agent/target/datastax-mgmtapi-agent-0.1.0-SNAPSHOT.jar"
143-
156+
144157
> alias mgmtapi="java -jar management-api-server/target/datastax-mgmtapi-server-0.1.0-SNAPSHOT.jar"
145-
158+
146159
# Start the service with a local unix socket only, you could also pass -H http://localhost:8080 to expose a port
147160
> mgmtapi --db-socket=/tmp/db.sock --host=unix:///tmp/mgmtapi.sock --db-home=<pathToCassandraOrDseHome>
148-
161+
149162
# Cassandra/DSE will be started by the service by default unless you pass --explicit-start flag
150-
163+
151164
# Check the service is up
152165
> curl --unix-socket /tmp/mgmtapi.sock http://localhost/api/v0/probes/liveness
153-
OK
154-
166+
OK
167+
155168
# Check C*/DSE is up
156-
> curl --unix-socket /tmp/mgmtapi.sock http://localhost/api/v0/probes/readiness
169+
> curl --unix-socket /tmp/mgmtapi.sock http://localhost/api/v0/probes/readiness
157170
OK
158-
171+
159172
# Stop C*/DSE
160173
curl -XPOST --unix-socket /tmp/mgmtapi.sock http://localhost/api/v0/lifecycle/stop
161174
OK
162175

163176
# CLI Help
164177
The CLI help covers the different options:
165-
178+
166179
mgmtapi --help
167-
180+
168181
NAME
169182
cassandra-management-api - REST service for managing an Apache
170183
Cassandra or DSE node
@@ -238,15 +251,15 @@ docker run -p 8080:8080 -it --rm mgmtapi-dse
238251
This options value must be a path on the file system that must be
239252
readable.
240253

241-
254+
242255
COPYRIGHT
243256
Copyright (c) DataStax 2020
244-
257+
245258
LICENSE
246259
Please see https://www.apache.org/licenses/LICENSE-2.0 for more
247260
information
248261

249-
262+
250263
## Roadmap
251264
* CQL based configuration changes
252265
* Configuration as system table

management-api-agent-common/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Management API Agent
22

3-
The Agent is the bridge between the Management API and the instance of Cassandra or DSE it controls.
3+
The Agent is the bridge between the Management API and the instance of Apache Cassandra&trade; or DSE it controls.
44
This is accomplished by adding the agent jarfile to the startup options of the server with the `-javaagent`
55
directive. See the [main README](../README.md#using-the-service-with-a-locally-installed-c-or-dse-instance)
66
as an example.

management-api-server/doc/openapi.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"openapi" : "3.0.1",
33
"info" : {
4-
"title" : "Management API for Apache Cassandra",
5-
"description" : "This is a Restful service for operating Apache Cassandra. You can find out more about the Management API on [Github](http://github.com/datastax/management-api-for-apache-cassandra)",
4+
"title" : "Management API for Apache Cassandra",
5+
"description" : "This is a Restful service for operating Apache Cassandra. You can find out more about the Management API on [Github](http://github.com/k8ssandra/management-api-for-apache-cassandra)",
66
"license" : {
77
"name" : "Apache 2.0",
88
"url" : "http://www.apache.org/licenses/LICENSE-2.0.html"

management-api-server/src/main/resources/openapi-configuration.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"openAPI": {
88
"info": {
99
"version": "0.1",
10-
"title": "Management API for Apache Cassandra",
11-
"description": "This is a Restful service for operating Apache Cassandra. You can find out more about the Management API on [Github](http://github.com/datastax/management-api-for-apache-cassandra)",
10+
"title": "Management API for Apache Cassandra",
11+
"description": "This is a Restful service for operating Apache Cassandra. You can find out more about the Management API on [Github](http://github.com/k8ssandra/management-api-for-apache-cassandra)",
1212
"license": {
1313
"name": "Apache 2.0",
1414
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"

0 commit comments

Comments
 (0)