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 #
| Flag | Description | Default |
|---|---|---|
-n, --port | Port to listen on | 11001 |
-a, --address | IP address to bind to | "0.0.0.0" |
--max-connections | Maximum client connections | 10000 |
--timeout | Connection timeout (seconds) | 30 |
Storage Configuration #
| Flag | Description | Default |
|---|---|---|
-storage-backend | Storage backend driver | "leveldb" |
-j, --data-dir | Data directory path | "./data" |
--compression | Enable compression | true |
--cache-size | Cache size (MB) | 1024 |
Supported Storage Drivers #
leveldb- Google LevelDB (default)badger- Dgraph BadgerDBipfs- IPFS decentralized storagecrdt- CRDT-based storageipfs-log- IPFS append-only logoss- Object storage servicehybriddb- Tiered hot/cold storage
P2P Network Configuration #
| Flag | Description | Default |
|---|---|---|
--p2p-enable | Enable P2P networking | false |
--discovery-id | Network discovery ID | "icefiredb_cluster" |
--bootstrap-peers | Bootstrap peer addresses | [] |
--p2p-listen | P2P listen address | "/ip4/0.0.0.0/tcp/4001" |
Logging Configuration #
| Flag | Description | Default |
|---|---|---|
--log-level | Log level (debug, info, warn, error) | "info" |
--log-output | Output destination (stdout, file) | "stdout" |
--log-file | Log file path (if output=file) | "./icefiredb.log" |
--log-max-size | Max log file size (MB) | 100 |
--log-max-backups | Max backup files | 7 |
Advanced Configuration Options #
Performance Tuning #
| Flag | Description | Default |
|---|---|---|
--max-memory | Maximum memory usage (bytes) | 1073741824 (1GB) |
--cache-size | Cache size (MB) | 1024 |
--max-clients | Maximum client connections | 10000 |
--openreads | Enable open reads optimization | false |
Security Configuration #
| Flag | Description | Default |
|---|---|---|
--tls-enable | Enable TLS encryption | false |
--tls-cert | TLS certificate file | "./certs/server.crt" |
--tls-key | TLS private key file | "./certs/server.key" |
--auth-password | Authentication password | "" |
--ip-whitelist | IP 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 Variable | Equivalent 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 #
- Use descriptive data directories for different storage backends
- Set appropriate memory limits based on your system resources
- Enable compression for better storage efficiency
- Use environment variables for sensitive configuration
- Monitor performance and adjust settings as needed
- Test different storage backends for your specific workload
- Use the
--openreadsflag 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
-nflag - Permission denied: Check permissions on data directory
- Out of memory: Adjust
--max-memorysetting - Storage backend not available: Verify the backend is compiled in
Getting Support #
If you encounter issues:
- Check the logs with
--log-level debug - Verify your command-line syntax
- Consult the GitHub issues
- 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 #
- Use environment variables for sensitive data like passwords
- Document your deployment commands for reproducibility
- Test configurations before production deployment
- Use version control for deployment scripts
- Test different storage backends for your workload
- Monitor performance and adjust settings accordingly
- Use the
--helpflag 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 #
- Deployment Guide - Deployment instructions
- API Reference - Command documentation
- Storage Drivers - Storage backend details