mirror of
https://github.com/DeBrosOfficial/network.git
synced 2025-12-12 23:18:49 +00:00
refactor: remove RQLite as a separate service management entity
- Updated production command handling to reflect that RQLite is now managed internally by the node process, eliminating the need for separate service definitions and binary paths. - Adjusted logging and service management functions to streamline operations and improve clarity regarding RQLite's integration. - Enhanced log file creation to be node-type specific, ensuring only relevant logs are generated based on the node type being installed.
This commit is contained in:
parent
c405be3e69
commit
2b17bcdaa2
14
CHANGELOG.md
14
CHANGELOG.md
@ -13,6 +13,20 @@ The format is based on [Keep a Changelog][keepachangelog] and adheres to [Semant
|
|||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
## [0.69.4] - 2025-11-11
|
||||||
|
|
||||||
|
### Added
|
||||||
|
\n
|
||||||
|
### Changed
|
||||||
|
- RQLite database management is now integrated directly into the main node process, removing separate RQLite systemd services (debros-rqlite-*).
|
||||||
|
- Improved log file provisioning to only create necessary log files based on the node type being installed (bootstrap or node).
|
||||||
|
|
||||||
|
### Deprecated
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
\n
|
||||||
## [0.69.3] - 2025-11-11
|
## [0.69.3] - 2025-11-11
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
2
Makefile
2
Makefile
@ -19,7 +19,7 @@ test-e2e:
|
|||||||
|
|
||||||
.PHONY: build clean test run-node run-node2 run-node3 run-example deps tidy fmt vet lint clear-ports install-hooks kill
|
.PHONY: build clean test run-node run-node2 run-node3 run-example deps tidy fmt vet lint clear-ports install-hooks kill
|
||||||
|
|
||||||
VERSION := 0.69.3
|
VERSION := 0.69.4
|
||||||
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
||||||
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
|
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||||
LDFLAGS := -X 'main.version=$(VERSION)' -X 'main.commit=$(COMMIT)' -X 'main.date=$(DATE)'
|
LDFLAGS := -X 'main.version=$(VERSION)' -X 'main.commit=$(COMMIT)' -X 'main.date=$(DATE)'
|
||||||
|
|||||||
@ -330,8 +330,7 @@ func handleProdUpgrade(args []string) {
|
|||||||
"debros-ipfs-cluster-node.service",
|
"debros-ipfs-cluster-node.service",
|
||||||
"debros-ipfs-bootstrap.service",
|
"debros-ipfs-bootstrap.service",
|
||||||
"debros-ipfs-node.service",
|
"debros-ipfs-node.service",
|
||||||
"debros-rqlite-bootstrap.service",
|
// Note: RQLite is managed by node process, not as separate service
|
||||||
"debros-rqlite-node.service",
|
|
||||||
"debros-olric.service",
|
"debros-olric.service",
|
||||||
}
|
}
|
||||||
for _, svc := range services {
|
for _, svc := range services {
|
||||||
@ -515,7 +514,7 @@ func handleProdUpgrade(args []string) {
|
|||||||
services := []string{
|
services := []string{
|
||||||
"debros-ipfs-bootstrap",
|
"debros-ipfs-bootstrap",
|
||||||
"debros-ipfs-cluster-bootstrap",
|
"debros-ipfs-cluster-bootstrap",
|
||||||
"debros-rqlite-bootstrap",
|
// Note: RQLite is managed by node process, not as separate service
|
||||||
"debros-olric",
|
"debros-olric",
|
||||||
"debros-node-bootstrap",
|
"debros-node-bootstrap",
|
||||||
"debros-gateway",
|
"debros-gateway",
|
||||||
@ -541,8 +540,7 @@ func handleProdStatus() {
|
|||||||
"debros-ipfs-node",
|
"debros-ipfs-node",
|
||||||
"debros-ipfs-cluster-bootstrap",
|
"debros-ipfs-cluster-bootstrap",
|
||||||
"debros-ipfs-cluster-node",
|
"debros-ipfs-cluster-node",
|
||||||
"debros-rqlite-bootstrap",
|
// Note: RQLite is managed by node process, not as separate service
|
||||||
"debros-rqlite-node",
|
|
||||||
"debros-olric",
|
"debros-olric",
|
||||||
"debros-node-bootstrap",
|
"debros-node-bootstrap",
|
||||||
"debros-node-node",
|
"debros-node-node",
|
||||||
@ -555,11 +553,9 @@ func handleProdStatus() {
|
|||||||
"debros-ipfs-node": "IPFS Daemon (Node)",
|
"debros-ipfs-node": "IPFS Daemon (Node)",
|
||||||
"debros-ipfs-cluster-bootstrap": "IPFS Cluster (Bootstrap)",
|
"debros-ipfs-cluster-bootstrap": "IPFS Cluster (Bootstrap)",
|
||||||
"debros-ipfs-cluster-node": "IPFS Cluster (Node)",
|
"debros-ipfs-cluster-node": "IPFS Cluster (Node)",
|
||||||
"debros-rqlite-bootstrap": "RQLite Database (Bootstrap)",
|
|
||||||
"debros-rqlite-node": "RQLite Database (Node)",
|
|
||||||
"debros-olric": "Olric Cache Server",
|
"debros-olric": "Olric Cache Server",
|
||||||
"debros-node-bootstrap": "DeBros Node (Bootstrap)",
|
"debros-node-bootstrap": "DeBros Node (Bootstrap) - includes RQLite",
|
||||||
"debros-node-node": "DeBros Node (Node)",
|
"debros-node-node": "DeBros Node (Node) - includes RQLite",
|
||||||
"debros-gateway": "DeBros Gateway",
|
"debros-gateway": "DeBros Gateway",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -626,8 +622,7 @@ func getProductionServices() []string {
|
|||||||
"debros-node-node",
|
"debros-node-node",
|
||||||
"debros-node-bootstrap",
|
"debros-node-bootstrap",
|
||||||
"debros-olric",
|
"debros-olric",
|
||||||
"debros-rqlite-bootstrap",
|
// Note: RQLite is managed by node process, not as separate service
|
||||||
"debros-rqlite-node",
|
|
||||||
"debros-ipfs-cluster-bootstrap",
|
"debros-ipfs-cluster-bootstrap",
|
||||||
"debros-ipfs-cluster-node",
|
"debros-ipfs-cluster-node",
|
||||||
"debros-ipfs-bootstrap",
|
"debros-ipfs-bootstrap",
|
||||||
@ -748,8 +743,7 @@ func handleProdUninstall() {
|
|||||||
"debros-node-node",
|
"debros-node-node",
|
||||||
"debros-node-bootstrap",
|
"debros-node-bootstrap",
|
||||||
"debros-olric",
|
"debros-olric",
|
||||||
"debros-rqlite-bootstrap",
|
// Note: RQLite is managed by node process, not as separate service
|
||||||
"debros-rqlite-node",
|
|
||||||
"debros-ipfs-cluster-bootstrap",
|
"debros-ipfs-cluster-bootstrap",
|
||||||
"debros-ipfs-cluster-node",
|
"debros-ipfs-cluster-node",
|
||||||
"debros-ipfs-bootstrap",
|
"debros-ipfs-bootstrap",
|
||||||
|
|||||||
@ -415,10 +415,7 @@ func (ps *ProductionSetup) Phase5CreateSystemdServices(nodeType string, vpsIP st
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("ipfs-cluster-service binary not available: %w", err)
|
return fmt.Errorf("ipfs-cluster-service binary not available: %w", err)
|
||||||
}
|
}
|
||||||
rqliteBinary, err := ps.binaryInstaller.ResolveBinaryPath("rqlited", "/usr/local/bin/rqlited", "/usr/bin/rqlited")
|
// Note: rqlited binary is not needed as a separate service - node manages RQLite internally
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("rqlited binary not available: %w", err)
|
|
||||||
}
|
|
||||||
olricBinary, err := ps.binaryInstaller.ResolveBinaryPath("olric-server", "/usr/local/bin/olric-server", "/usr/bin/olric-server")
|
olricBinary, err := ps.binaryInstaller.ResolveBinaryPath("olric-server", "/usr/local/bin/olric-server", "/usr/bin/olric-server")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("olric-server binary not available: %w", err)
|
return fmt.Errorf("olric-server binary not available: %w", err)
|
||||||
@ -440,25 +437,8 @@ func (ps *ProductionSetup) Phase5CreateSystemdServices(nodeType string, vpsIP st
|
|||||||
}
|
}
|
||||||
ps.logf(" ✓ IPFS Cluster service created: %s", clusterUnitName)
|
ps.logf(" ✓ IPFS Cluster service created: %s", clusterUnitName)
|
||||||
|
|
||||||
// RQLite service with join address for non-bootstrap nodes
|
// Note: RQLite is managed internally by the node process, not as a separate systemd service
|
||||||
rqliteJoinAddr := ""
|
ps.logf(" ℹ️ RQLite will be managed by the node process")
|
||||||
if nodeType != "bootstrap" && vpsIP != "" {
|
|
||||||
rqliteJoinAddr = vpsIP + ":7001"
|
|
||||||
}
|
|
||||||
|
|
||||||
// Log the advertise configuration for verification
|
|
||||||
advertiseIP := vpsIP
|
|
||||||
if advertiseIP == "" {
|
|
||||||
advertiseIP = "127.0.0.1"
|
|
||||||
}
|
|
||||||
ps.logf(" RQLite will advertise: %s (advertise IP: %s)", rqliteJoinAddr, advertiseIP)
|
|
||||||
|
|
||||||
rqliteUnit := ps.serviceGenerator.GenerateRQLiteService(nodeType, rqliteBinary, 5001, 7001, rqliteJoinAddr, advertiseIP)
|
|
||||||
rqliteUnitName := fmt.Sprintf("debros-rqlite-%s.service", nodeType)
|
|
||||||
if err := ps.serviceController.WriteServiceUnit(rqliteUnitName, rqliteUnit); err != nil {
|
|
||||||
return fmt.Errorf("failed to write RQLite service: %w", err)
|
|
||||||
}
|
|
||||||
ps.logf(" ✓ RQLite service created: %s", rqliteUnitName)
|
|
||||||
|
|
||||||
// Olric service
|
// Olric service
|
||||||
olricUnit := ps.serviceGenerator.GenerateOlricService(olricBinary)
|
olricUnit := ps.serviceGenerator.GenerateOlricService(olricBinary)
|
||||||
@ -488,8 +468,8 @@ func (ps *ProductionSetup) Phase5CreateSystemdServices(nodeType string, vpsIP st
|
|||||||
}
|
}
|
||||||
ps.logf(" ✓ Systemd daemon reloaded")
|
ps.logf(" ✓ Systemd daemon reloaded")
|
||||||
|
|
||||||
// Enable services
|
// Enable services (RQLite is managed by node, not as separate service)
|
||||||
services := []string{unitName, clusterUnitName, rqliteUnitName, "debros-olric.service", nodeUnitName, "debros-gateway.service"}
|
services := []string{unitName, clusterUnitName, "debros-olric.service", nodeUnitName, "debros-gateway.service"}
|
||||||
for _, svc := range services {
|
for _, svc := range services {
|
||||||
if err := ps.serviceController.EnableService(svc); err != nil {
|
if err := ps.serviceController.EnableService(svc); err != nil {
|
||||||
ps.logf(" ⚠️ Failed to enable %s: %v", svc, err)
|
ps.logf(" ⚠️ Failed to enable %s: %v", svc, err)
|
||||||
@ -501,8 +481,8 @@ func (ps *ProductionSetup) Phase5CreateSystemdServices(nodeType string, vpsIP st
|
|||||||
// Start services in dependency order
|
// Start services in dependency order
|
||||||
ps.logf(" Starting services...")
|
ps.logf(" Starting services...")
|
||||||
|
|
||||||
// Start infrastructure first (IPFS, RQLite, Olric)
|
// Start infrastructure first (IPFS, Olric) - RQLite is managed by node
|
||||||
infraServices := []string{unitName, rqliteUnitName, "debros-olric.service"}
|
infraServices := []string{unitName, "debros-olric.service"}
|
||||||
for _, svc := range infraServices {
|
for _, svc := range infraServices {
|
||||||
if err := ps.serviceController.StartService(svc); err != nil {
|
if err := ps.serviceController.StartService(svc); err != nil {
|
||||||
ps.logf(" ⚠️ Failed to start %s: %v", svc, err)
|
ps.logf(" ⚠️ Failed to start %s: %v", svc, err)
|
||||||
|
|||||||
@ -55,18 +55,26 @@ func (fp *FilesystemProvisioner) EnsureDirectoryStructure(nodeType string) error
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create log files with correct permissions so systemd can write to them
|
// Create log files with correct permissions so systemd can write to them
|
||||||
|
// Only create logs for the specific nodeType being installed
|
||||||
logsDir := filepath.Join(fp.debrosDir, "logs")
|
logsDir := filepath.Join(fp.debrosDir, "logs")
|
||||||
logFiles := []string{
|
logFiles := []string{
|
||||||
"olric.log",
|
"olric.log",
|
||||||
"gateway.log",
|
"gateway.log",
|
||||||
"ipfs-bootstrap.log",
|
}
|
||||||
"ipfs-cluster-bootstrap.log",
|
|
||||||
"rqlite-bootstrap.log",
|
// Add node-type-specific log files only if nodeType is specified
|
||||||
"node-bootstrap.log",
|
if nodeType == "bootstrap" {
|
||||||
"ipfs-node.log",
|
logFiles = append(logFiles,
|
||||||
"ipfs-cluster-node.log",
|
"ipfs-bootstrap.log",
|
||||||
"rqlite-node.log",
|
"ipfs-cluster-bootstrap.log",
|
||||||
"node-node.log",
|
"node-bootstrap.log",
|
||||||
|
)
|
||||||
|
} else if nodeType == "node" {
|
||||||
|
logFiles = append(logFiles,
|
||||||
|
"ipfs-node.log",
|
||||||
|
"ipfs-cluster-node.log",
|
||||||
|
"node-node.log",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, logFile := range logFiles {
|
for _, logFile := range logFiles {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user