Difference between revisions of "PKI ACME Responder with Cassandra Database"

From Dogtag
Jump to: navigation, search
m (Removing Database)
m (Initializing Database)
Line 9: Line 9:
  
 
= Initializing Database =
 
= Initializing Database =
 +
 +
To create a local database:
 +
 +
<pre>
 +
$ cqlsh -u cassandra -p cassandra
 +
cqlsh> CREATE KEYSPACE acme WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
 +
</pre>
  
 
To initialize a local database:
 
To initialize a local database:

Revision as of 04:08, 29 July 2020

Installing JDBC Driver

$ dnf install cassandra-java-driver
$ cd /usr/share/pki/server/common/lib
$ ln -s /usr/share/java/cassandra-java-driver/cassandra-driver-core.jar
$ wget https://github.com/adejanovski/cassandra-jdbc-wrapper/releases/download/3.1.0/cassandra-jdbc-wrapper-3.1.0.jar

Initializing Database

To create a local database:

$ cqlsh -u cassandra -p cassandra
cqlsh> CREATE KEYSPACE acme WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };

To initialize a local database:

$ cqlsh -u cassandra -p cassandra -k acme -f /usr/share/pki/acme/database/cassandra/create.sql

To initialize a remote database:

$ cqlsh --cqlshrc=cqlshrc -u pki -p Secret.123 -k acme -f /usr/share/pki/acme/database/cassandra/create.sql

Configuring ACME Responder

To configure PKI ACME responder with a Cassandra database:

$ cp /usr/share/pki/acme/database/cassandra/database.conf /etc/pki/pki-tomcat/acme/database.conf

The configuration will be stored in /etc/pki/pki-tomcat/acme/database.conf, for example:

class=org.dogtagpki.acme.database.CassandraDatabase
url=jdbc:cassandra://localhost.localdomain:9042/acme
user=cassandra
password=cassandra

Removing Database

To remove a local database:

$ cqlsh -u cassandra -p cassandra -k acme -f /usr/share/pki/acme/database/cassandra/drop.sql

To remove a remote database:

$ cqlsh --cqlshrc=cqlshrc -u pki -p Secret.123 -k acme -f /usr/share/pki/acme/database/cassandra/drop.sql

See Also