Skip to content

Latest commit

 

History

History
75 lines (57 loc) · 2.36 KB

Readme.md

File metadata and controls

75 lines (57 loc) · 2.36 KB

Cassandra to Spanner Proxy Service Setup and Management Guide

This guide outlines the steps to set up and manage the Cassandra to Spanner proxy service using systemd on a Linux-based system. The proxy service ensures reliable operation by starting automatically at boot and restarting on failure.

Setup Instructions

Before managing the service, you must first run the setup script systemd.sh, which configures the system to run the Cassandra to Spanner proxy as a service.

Running the Setup Script

  1. Switch the current user to the root user sudo su -
  2. Navigate to the systemd directory containing the systemd.sh script. 3.Add the appropriate values for the below variables in the systemd.cfg file.
SPANNER_CONFIG_TABLE="TableConfigurations"
SPANNER_DB_NAME="<<comma seperated table names>>"
GCP_PROJECT_ID="<<gcp-project-id>>"
SPANNER_INSTANCE="<<spanner-instance-name>>"
  1. Make the script executable and run it:
chmod +x systemd.sh
source ./systemd.sh

This script builds the application, copies the binary to the appropriate location, sets up environment variables, and creates a systemd service file for the proxy.

Managing the Service

After running the setup script, you can manage the Cassandra to Spanner proxy service using the following systemd commands

Checking Service Status

To view the current status of the service:

systemctl status cassandraproxy.service

Starting the Service

To start the service if it's not already running:

systemctl start cassandraproxy.service

Stopping the Service

To stop the service

systemctl stop cassandraproxy.service

Restarting the Service

To restart the service (useful after configuration changes)

systemctl restart cassandraproxy.service

Viewing Service Logs

Logs are essential for monitoring the service's health and troubleshooting issues.

Tailing Logs in Real Time

To follow the service's logs in real-time:

journalctl -fu cassandraproxy.service

Checking Historical Logs

To view all logs generated by the service:

journalctl -u cassandraproxy.service

Additional Notes

  • Commands to manage the service and view logs may require root privileges or sudo.
  • The setup script systemd.sh must be executed from its location within the project or the systemd subfolder, as outlined in the setup instructions.