Configuration Guide

IceFireDB Configuration Guide #

Overview #

IceFireDB NoSQL component uses command-line flags for configuration instead of YAML configuration files. This guide covers all available command-line options for the NoSQL component.

Command-Line Interface #

The IceFireDB NoSQL component is configured using command-line flags. Here’s the basic usage:

# Basic usage
./icefiredb-nosql [options]

# Example with common flags
./icefiredb-nosql \
  -storage-backend leveldb \
  -n 11001 \
  -a 0.0.0.0 \
  -j ./data \
  --openreads

Command-Line Options #

Network Configuration #

FlagDescriptionDefault
-n, --portPort to listen on11001
-a, --addressIP address to bind to"0.0.0.0"
--max-connectionsMaximum client connections10000
--timeoutConnection timeout (seconds)30

Storage Configuration #

FlagDescriptionDefault
-storage-backendStorage backend driver"leveldb"
-j, --data-dirData directory path"./data"
--compressionEnable compressiontrue
--cache-sizeCache size (MB)1024

Supported Storage Drivers #

  • leveldb - Google LevelDB (default)
  • badger - Dgraph BadgerDB
  • ipfs - IPFS decentralized storage
  • crdt - CRDT-based storage
  • ipfs-log - IPFS append-only log
  • oss - Object storage service
  • hybriddb - Tiered hot/cold storage

P2P Network Configuration #

FlagDescriptionDefault
--p2p-enableEnable P2P networkingfalse
--discovery-idNetwork discovery ID"icefiredb_cluster"
--bootstrap-peersBootstrap peer addresses[]
--p2p-listenP2P listen address"/ip4/0.0.0.0/tcp/4001"

Logging Configuration #

FlagDescriptionDefault
--log-levelLog level (debug, info, warn, error)"info"
--log-outputOutput destination (stdout, file)"stdout"
--log-fileLog file path (if output=file)"./icefiredb.log"
--log-max-sizeMax log file size (MB)100
--log-max-backupsMax backup files7

Advanced Configuration Options #

Performance Tuning #

FlagDescriptionDefault
--max-memoryMaximum memory usage (bytes)1073741824 (1GB)
--cache-sizeCache size (MB)1024
--max-clientsMaximum client connections10000
--openreadsEnable open reads optimizationfalse

Security Configuration #

FlagDescriptionDefault
--tls-enableEnable TLS encryptionfalse
--tls-certTLS certificate file"./certs/server.crt"
--tls-keyTLS private key file"./certs/server.key"
--auth-passwordAuthentication password""
--ip-whitelistIP whitelist (comma-separated)""

Usage Examples #

Basic Deployment #

# Start with default settings
./icefiredb-nosql

# Start on specific port and address
./icefiredb-nosql -n 12000 -a 127.0.0.1

# Use BadgerDB storage backend
./icefiredb-nosql -storage-backend badger -j ./badger_data

# Enable P2P networking
./icefiredb-nosql --p2p-enable --discovery-id "my_cluster"

Production Deployment #

./icefiredb-nosql \
  -storage-backend badger \
  -n 11001 \
  -a 0.0.0.0 \
  -j /var/lib/icefiredb \
  --log-level warn \
  --log-file /var/log/icefiredb.log \
  --max-memory 4294967296 \
  --cache-size 2048 \
  --openreads

Decentralized Deployment #

./icefiredb-nosql \
  -storage-backend ipfs \
  -n 11001 \
  -j ./ipfs_data \
  --p2p-enable \
  --discovery-id "decentralized_cluster" \
  --bootstrap-peers "/ip4/192.168.1.100/tcp/4001/p2p/QmPeer1"

Environment Variables #

IceFireDB NoSQL also supports configuration through environment variables:

Environment VariableEquivalent Flag
ICEFIREDB_PORT-n, --port
ICEFIREDB_ADDRESS-a, --address
ICEFIREDB_DATA_DIR-j, --data-dir
ICEFIREDB_STORAGE_BACKEND-storage-backend
ICEFIREDB_LOG_LEVEL--log-level
ICEFIREDB_P2P_ENABLE--p2p-enable

Getting Help #

To see all available command-line options:

# Show help and all available flags
./icefiredb-nosql --help

# Show version information
./icefiredb-nosql --version

Configuration Best Practices #

  1. Use descriptive data directories for different storage backends
  2. Set appropriate memory limits based on your system resources
  3. Enable compression for better storage efficiency
  4. Use environment variables for sensitive configuration
  5. Monitor performance and adjust settings as needed
  6. Test different storage backends for your specific workload
  7. Use the --openreads flag for read-intensive workloads

Monitoring and Debugging #

Built-in Monitoring #

IceFireDB provides built-in monitoring through Redis commands:

# Get server information
127.0.0.1:11001> INFO

# Monitor memory usage
127.0.0.1:11001> INFO memory

# Check storage statistics
127.0.0.1:11001> INFO storage

# View slow queries
127.0.0.1:11001> SLOWLOG GET 10

Debug Mode #

Enable debug logging for troubleshooting:

./icefiredb-nosql --log-level debug --log-output stdout

Troubleshooting #

Common Issues #

  • Port already in use: Use a different port with -n flag
  • Permission denied: Check permissions on data directory
  • Out of memory: Adjust --max-memory setting
  • Storage backend not available: Verify the backend is compiled in

Getting Support #

If you encounter issues:

  1. Check the logs with --log-level debug
  2. Verify your command-line syntax
  3. Consult the GitHub issues
  4. Join the community discussions

Configuration Validation #

IceFireDB validates command-line options on startup. Common validation errors include:

  • Invalid flag syntax
  • Unknown configuration options
  • Invalid file paths
  • Port conflicts
  • Memory limits exceeding available system memory

Runtime Configuration #

Some configuration options can be changed at runtime using Redis commands:

# Get configuration information
127.0.0.1:11001> CONFIG GET log-level

# Change log level at runtime
127.0.0.1:11001> CONFIG SET log-level "debug"

# Get storage driver information
127.0.0.1:11001> DRIVER.INFO

Best Practices #

  1. Use environment variables for sensitive data like passwords
  2. Document your deployment commands for reproducibility
  3. Test configurations before production deployment
  4. Use version control for deployment scripts
  5. Test different storage backends for your workload
  6. Monitor performance and adjust settings accordingly
  7. Use the --help flag to explore all available options

Troubleshooting #

Common Issues #

  • Port already in use: Change network.port
  • Permission denied: Check file permissions for data directory
  • Out of memory: Adjust performance.max_memory
  • Storage driver not found: Verify driver name and dependencies

Debug Mode #

Enable debug logging for troubleshooting:

log:
  level: "debug"
  output: "stdout"

See Also #