Apache CouchDB, often shortened to just “CouchDB”, is an open-source NoSQL database that uses JSON to store data, JavaScript as its query language using MapReduce, and HTTP for its API. It’s known for its ease of use, scalability, and fault-tolerant replication capabilities, making it a popular choice for distributed applications.
Setting Up Your Environment
Before deploying CouchDB on Akash, ensure you have the following prerequisites:
-
Akash Network Account: You should have an account on the Akash Network with sufficient AKT tokens to deploy the service.
-
Akash CLI or Console Access: Set up and configured on your machine.
-
Docker Knowledge: Familiarity with Docker is helpful.
Creating the SDL File
Below is a sample SDL file to deploy CouchDB using the official Docker image:
---version: "2.0"
services: couchdb: image: couchdb env: - COUCHDB_USER=admin - COUCHDB_PASSWORD=password expose: - port: 5984 as: 80 to: - global: true
profiles: compute: couchdb: resources: cpu: units: 1.0 memory: size: 1Gi storage: size: 1Gi placement: akash: attributes: host: akash signedBy: anyOf: - "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63" pricing: couchdb: denom: uakt amount: 10000
deployment: couchdb: akash: profile: couchdb count: 1
-
services
: Defines the Docker image and port mapping. -
profiles
: Specifies the compute resources required (CPU, memory, and storage). -
deployment
: Sets the profile and instance count.
Save this file as deploy.yaml
.
Deploying CouchDB on Akash
Using the CLI
Step 1: Authenticate with Akash
First, authenticate your Akash account:
akash tx authz grant <spender> --msg-type <message-type> --from <your-account-name> --node <node-url>
Replace <spender>
, <message-type>
, <your-account-name>
, and <node-url>
with your specific values.
Step 2: Create and Fund a Deployment
Upload your deploy.yaml
SDL file:
akash tx deployment create deploy.yaml --from <your-account-name>
Fund your deployment with AKT:
akash tx deployment deposit <deployment-id> <amount>uakt --from <your-account-name>
Wait for the deployment to be accepted by a provider.
Step 3: Monitor and Access CouchDB
Once the deployment is active, retrieve the access details:
akash query deployment get <deployment-id>
You’ll receive the public IP or domain for accessing CouchDB.
For a more detailed CLI deployment guide, refer to Akash CLI Deployment Guide on the Akash documentation site.
Using the Console
If you prefer a UI-based approach, you can deploy CouchDB using the Akash Console:
-
Visit the Akash Console.
-
Sign in with your Keplr wallet.
-
Upload your deploy.yaml SDL file in the “Create Deployment” section.
-
Configure the deployment settings (similar to the CLI method).
-
Submit the deployment and fund it with the required AKT.
-
Monitor the deployment status via the console interface.
For more detailed instructions, you can refer to the Akash Console Guide.
Post-Deployment: Setting Up CouchDB
After your CouchDB instance is up and running:
- Access the CouchDB Dashboard:
-
Use the IP or domain provided during the deployment.
-
The default port for CouchDB is
5984
.
- Secure CouchDB:
- CouchDB is insecure by default. Set up an admin user by running the following command:
curl -X PUT http://<your-ip>:5984/_node/_local/_config/admins/admin -d '"password"'
- Replace
<your-ip>
with your actual IP andpassword
with your desired admin password.
- Verify Installation:
Access the CouchDB dashboard by navigating to http://<your-ip>:5984/_utils/
.