๐ Introduction
Setting up a database is more than just installationโitโs about building a stable and scalable environment.
When working with GBase database, proper deployment ensures:
- โ High availability
- โ Stable performance
- โ Easy maintenance
This guide walks you through installation, configuration, and service management in a practical way.
๐งฑ Understanding GBase Deployment Architecture
A typical GBase database setup includes:
- Database engine (core service)
- Configuration files
- Storage (chunks / data files)
- Network configuration
๐ These components must be properly configured for the system to work correctly.
๐ฆ Step 1: Prepare the Environment
Before installation, ensure your system meets requirements:
- Linux OS (recommended)
- Sufficient memory and disk space
- Root or database user permissions
๐ง Create GBase User
```bash id="c2xj6q"
useradd -m gbase
passwd gbase
---
### ๐ Set Installation Directory
```bash id="4m5l8f"
mkdir -p /opt/gbase
chown -R gbase:gbase /opt/gbase
โ๏ธ Step 2: Configure Environment Variables
Environment variables are critical for GBase.
```bash id="k7x5m2"
export GBASEDBTDIR=/opt/gbase
export GBASEDBTSERVER=gbaseserver
export ONCONFIG=onconfig.gbaseserver
export PATH=$GBASEDBTDIR/bin:$PATH
๐ These define:
* Installation path
* Instance name
* Configuration file
---
## ๐งพ Step 3: Configure ONCONFIG File
The `onconfig` file controls database behavior.
Example parameters:
```bash id="z9r6x1"
DBSERVERNAME gbaseserver
ROOTPATH /opt/gbase/rootdbs
LOGFILES 6
LOGSIZE 10000
Key Parameters:
-
DBSERVERNAMEโ instance name -
ROOTPATHโ storage location -
LOGFILESโ number of logs -
LOGSIZEโ size of each log
๐ฝ Step 4: Initialize Storage
Create database storage (chunks):
```bash id="x3h8qk"
onspaces -c -d rootdbs -p /opt/gbase/rootdbs -o 0 -s 100000
๐ This initializes the root database space.
---
## ๐ Step 5: Start GBase Database
```bash id="y2f8ds"
oninit -vy
Verify Status:
```bash id="d5k7mn"
onstat -
Expected output:
```text id="gq8n1p"
On-Line -- Up 00:00:10
๐ Step 6: Configure Network Access
Edit sqlhosts file:
```bash id="m1s9kd"
gbaseserver onsoctcp 127.0.0.1 9088
๐ Defines how clients connect to the database.
---
## ๐งช Step 7: Test Connection
```bash id="p8f2we"
dbaccess testdb
Or run a simple query:
```sql id="r3m6tx"
SELECT * FROM systables;
---
## โ๏ธ Step 8: Service Management
### Stop Database
```bash id="b7k4vn"
onmode -ky
Restart Database
```bash id="n9t6yz"
onmode -ky
oninit -vy
---
## ๐ Monitoring the Database
### Check Logs
```bash id="j6r8xp"
onstat -m
Check Performance
```bash id="u4t9ws"
onstat -p
---
### Check Sessions
```bash id="q2v5la"
onstat -g ses
๐ These tools help track system health and performance.
โ ๏ธ Common Deployment Issues
โ Database Fails to Start
- Incorrect environment variables
- Missing storage files
โ Connection Refused
- Wrong
sqlhostsconfiguration - Port not open
โ Poor Performance
- Insufficient log space
- Incorrect memory settings
๐ง Best Practices
โ Use Dedicated User
Avoid running database as root.
โ Configure Logs Properly
Ensure enough log space for transactions.
โ Automate Startup
Use system services (e.g., systemd) for auto-start.
โ Monitor Regularly
Use onstat tools to track system state.
๐ Final Thoughts
Deploying GBase database correctly is the foundation of a reliable system.
With proper setup, you can:
๐ Ensure stability
๐ Improve performance
๐ Simplify maintenance
๐ฌ Key Takeaways
- Environment variables are critical
-
onconfigdefines system behavior -
oninitstarts the database - Monitoring tools help maintain stability
Top comments (0)