Getting Started
Single-page view · as markdown
Universal Directory
Universal Directory / Getting Started
Universal Directory stores named objects in a hierarchy, with a schema that
defines their attributes. Its udd server provides a development console and
JSON API for exploring objects, schema changes, persistence, and replication
state.
Current implementation #
The engine stores objects in memory and records changes in snapshots and write-ahead logs. Object identities remain stable when names or locations change. The schema is itself a collection of directory objects, so you can inspect definitions through the same tools used for ordinary objects.
The replication engine merges changes between nodes in process. Tests exercise
conflicting writes, deletion, interrupted synchronization, and recovery. The
GIP network fabric connects machines and supports the ud/msgs demonstration
service, but directory replication is not connected to that fabric yet. The
two-machine development fixture transfers its initial directory state in
process; it is not network enrollment.
Development boundary #
The JSON API has no authentication or authorization. Its default listener is
loopback, but --listen can change that. Keep it on a trusted local
interface: anyone who can reach it can read and modify the directory.
udd is a development server, not a deployment-ready directory service. There
is no supported network join workflow, automatic service registration, or
release-qualified package set in this repository. Build instructions live
in the repository's docs/building.md.
Start with Running udd and Objects and Identity.
Running udd
Universal Directory / Getting Started
Create a disposable directory and run udd against it to explore the console
and JSON API. Creating a domain is a separate operation from starting the
server, so a missing domain does not silently become an empty replacement.
Before you start #
Prepare the following:
- Build or install the
udddevelopment binary. - Choose a new data directory that contains no files you need.
- Keep the console listener on a trusted local interface.
The examples assume udd is on your command search path. Repository build
instructions are in docs/building.md; udd(8) documents the full command
interface.
Create and run a domain #
-
Create the domain with an explicit local machine address:
-
Start the existing domain:
-
Open
http://127.0.0.1:5389in your browser. The console displays the directory root, configuration, schema, and local machine object.
Stop the server with Ctrl-C before restarting it against the same data
directory. The daemon holds an exclusive lock on the directory for its
lifetime. A second startup or creation attempt fails immediately with
data directory is already in use; it does not wait or change the database.
The operating system releases the lock when the process exits, including an
abnormal exit. There is no lock file to remove.
The startup report identifies its recovered generation and replayed frames.
Keep the whole data directory together, including its private machine-key
file. Command-line arguments must be valid UTF-8; invalid bytes produce a
usage error with exit status 2.
Run without persistent files #
For a session whose state disappears at exit, run:
This mode uses the same persistence interfaces with an in-memory filesystem. It creates a fresh domain at startup and chooses a free loopback GIP port.
Understand startup failures #
A missing domain requires an explicit creation step. A damaged generation, unsupported format, or invalid machine key causes startup to fail. Preserve the original directory for diagnosis and restore from a known complete backup; do not delete individual generations to make recovery proceed.
A reported truncated tail is different: recovery identified incomplete, unacknowledged bytes at the end of the active log. A warning about the local machine object's key means the stored directory record does not match the private identity used by this process.
A node with no root object can exist after interrupted creation. It reports
no-root rather than serving a replacement domain. This is distinct from
successful recovery of a populated directory.
Explore two machines #
The repository's dev/two-dc.sh builds a disposable pair of machines and runs
both consoles on loopback. It prepares their shared directory state out of
band. The fabric and message tabs exercise real connections and message
outcomes, but do not demonstrate network directory replication.