Sample Ansible Configuration
This guide is for Commerical Storage Nodes, if you're looking to join the public network follow Quickstart Node Setup instead.
Prerequisites
- Completed setup of one Storage Node
- Installed Ansible
- Installed Docker
Ansible Configuration
There are a number of different tools to do cloud operations, this guide should be considered only an example and not a requirement for how to run Commerical Storage nodes.
Any environment that can reliability run the storage node image can be also be used.
This Ansible playbook is showing how a single host machine with multiple hard drives can run multiple Storage nodes. Each container's environment variables, storage volumes, and network ports are set according to the individual dictionary elements in storj_containers
.
Each Storage node requires its own external_port
, for communication with the Storj network. Similarly, each node ideally has a dedicated drive or mount point for its storage, identified by volume_mount
like /mnt/sdb or /mnt/sdc.
The Ansible loop
iterates over the list of dictionaries stored in the storj_containers
variable, executing the container deployment tasks for each dictionary item. This allows multiple Storage nodes with varying configurations to be deployed in a single playbook run.
Next define the hosts where Ansible tasks will be executed with an inventory file hosts.ini
, where you list the IP addresses or hostnames of your target machines, optionally grouped under bracketed headers to organize them. Here's a basic example:
With this inventory, you can target specific groups (e.g., [storagenode]
) or individual hosts in your Ansible playbooks.
To execute the playbook, specify your inventory file using the -i
option. This will run the playbook tasks on the hosts listed in your inventory.
On your host machine, you can view the status of your docker containers. Here are some useful commands
The docker ps
command lists all running Docker containers, it's useful for quickly checking which containers are active and their configurations.
The docker logs
command displays the standard output and standard error logs of a specified Docker container. To debug storagenode1
container for example you could do