chore: update documentation
This commit is contained in:
37
CLAUDE.md
37
CLAUDE.md
@@ -41,16 +41,47 @@ go install
|
|||||||
## Quick Start with Server
|
## Quick Start with Server
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 1. Start KVS server (in ../kvs/)
|
# 1. Start KVS server as daemon (in ../kvs/)
|
||||||
cd ../kvs && ./kvs config.yaml
|
cd ../kvs
|
||||||
|
./kvs start config.yaml
|
||||||
|
|
||||||
|
# Check server is running
|
||||||
|
./kvs status
|
||||||
|
|
||||||
|
# View logs to get root token
|
||||||
|
tail ~/.kvs/logs/kvs_config.yaml.log | grep "Token:"
|
||||||
|
|
||||||
# 2. Run shell
|
# 2. Run shell
|
||||||
|
cd ../kvs-sh
|
||||||
./kvs-shell
|
./kvs-shell
|
||||||
|
|
||||||
# 3. In shell:
|
# 3. In shell:
|
||||||
# connect http://localhost:8080
|
# connect http://localhost:8080
|
||||||
# auth $KVS_ROOT_TOKEN
|
# auth <root-token-from-logs>
|
||||||
# put test/data '{"hello":"world"}'
|
# put test/data '{"hello":"world"}'
|
||||||
|
|
||||||
|
# 4. Stop server when done
|
||||||
|
cd ../kvs
|
||||||
|
./kvs stop config
|
||||||
|
```
|
||||||
|
|
||||||
|
**Daemon Commands:**
|
||||||
|
```bash
|
||||||
|
# Start server
|
||||||
|
./kvs start config.yaml # or just: ./kvs start config
|
||||||
|
|
||||||
|
# Check status
|
||||||
|
./kvs status # Show all instances
|
||||||
|
./kvs status config # Show specific instance
|
||||||
|
|
||||||
|
# View logs
|
||||||
|
tail -f ~/.kvs/logs/kvs_config.yaml.log
|
||||||
|
|
||||||
|
# Stop server
|
||||||
|
./kvs stop config
|
||||||
|
|
||||||
|
# Restart server
|
||||||
|
./kvs restart config
|
||||||
```
|
```
|
||||||
|
|
||||||
**Important:** If auth fails with "token not found", the database has old data. Either:
|
**Important:** If auth fails with "token not found", the database has old data. Either:
|
||||||
|
39
README.md
39
README.md
@@ -65,6 +65,45 @@ kvs> put users/alice {"name": "Alice", "email": "alice@example.com"}
|
|||||||
kvs> get users/alice
|
kvs> get users/alice
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## KVS Server Management
|
||||||
|
|
||||||
|
If you're also running the KVS server locally, you can use the built-in daemon commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Start KVS server as background daemon
|
||||||
|
./kvs start config.yaml
|
||||||
|
|
||||||
|
# Check server status
|
||||||
|
./kvs status
|
||||||
|
|
||||||
|
# View server logs
|
||||||
|
tail -f ~/.kvs/logs/kvs_config.yaml.log
|
||||||
|
|
||||||
|
# Stop server
|
||||||
|
./kvs stop config
|
||||||
|
|
||||||
|
# Restart server
|
||||||
|
./kvs restart config
|
||||||
|
```
|
||||||
|
|
||||||
|
**Multiple instances:**
|
||||||
|
```bash
|
||||||
|
# Start a 3-node cluster
|
||||||
|
./kvs start node1.yaml
|
||||||
|
./kvs start node2.yaml
|
||||||
|
./kvs start node3.yaml
|
||||||
|
|
||||||
|
# Check all running instances
|
||||||
|
./kvs status
|
||||||
|
|
||||||
|
# Stop entire cluster
|
||||||
|
./kvs stop node1
|
||||||
|
./kvs stop node2
|
||||||
|
./kvs stop node3
|
||||||
|
```
|
||||||
|
|
||||||
|
For more details on server management, see the [main KVS documentation](../kvs/README.md#-process-management).
|
||||||
|
|
||||||
## Commands Reference
|
## Commands Reference
|
||||||
|
|
||||||
### Connection & Authentication
|
### Connection & Authentication
|
||||||
|
Reference in New Issue
Block a user