Service Locator

From Spire Trading Inc.
Revision as of 14:54, 4 February 2025 by Kamal (talk | contribs) (Created page with "The Service Locator is a centralized server responsible for authenticating account logins, creating and managing user accounts, organizing accounts into directories, controlli...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Service Locator is a centralized server responsible for authenticating account logins, creating and managing user accounts, organizing accounts into directories, controlling permissions, and registering available services. It acts as a critical component for coordinating access control and service discovery. The Service Locator integrates with a MySQL database to persistently store account details, directory structures, permissions, and service registration data.

Configuration

The Service Locator is configured via a YAML file that defines its network interface and data store settings. Below is the structure of the configuration file with example values:

---
# The network interface and port the Service Locator binds to.
interface: "0.0.0.0:20000"

data_store:
  # The address of the MySQL server (host:port).
  address: "127.0.0.1:3306"

  # The username for authenticating with MySQL.
  username: service_locator

  # The password for the MySQL user.
  password: securepassword123

  # The name of the database schema where data is stored.
  schema: service_locator_db
...

Installation & Setup

A setup.py script is provided for convenience to configure the Service Locator and generate the config.yml file. The script supports the following arguments:

python setup.py
  --local 0.0.0.0                   # Local interface (default: auto-detected IP)
  --mysql_address 127.0.0.1:3306    # MySQL server address
  --mysql_username admin            # MySQL username (default: spireadmin)
  --mysql_password [REQUIRED]       # MySQL password (no default)
  --mysql_schema service_db         # Database schema (default: spire)

Operations

Log files are generated as srv_[YYYY][MM][DD]_[HH]_[MM]_[SS].log in the runtime directory, upon termination, non-empty log files are moved into the log/ subfolder, while empty log files are deleted.

The Service Locator is managed through three core scripts:

start.sh Starts the Service Locator server, does nothing if the server is already running.

stop.sh Stops an existing server instance and waits for the server to terminate.

check.sh Verifies that the server is running.