https://github.com/tomaae/storj-deployment
Full compose multinode deployment for storj-node with exporters and grafana
https://github.com/tomaae/storj-deployment
docker-compose storj storj-exporter storj-node
Last synced: 2 months ago
JSON representation
Full compose multinode deployment for storj-node with exporters and grafana
- Host: GitHub
- URL: https://github.com/tomaae/storj-deployment
- Owner: tomaae
- License: gpl-3.0
- Archived: true
- Created: 2022-11-30T04:00:08.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-09T01:30:32.000Z (over 2 years ago)
- Last Synced: 2025-03-29T12:55:17.138Z (2 months ago)
- Topics: docker-compose, storj, storj-exporter, storj-node
- Language: PHP
- Homepage:
- Size: 130 KB
- Stars: 12
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-storj - Storj deployment - Ready to use docker definitions (including Grafana, prometheus exporters, etc...) (Clients with Storj support and integrations)
README
# storj-deployment
Full compose multinode deployment for storj-node with exporters and grafana.This implementation aims to gather all available information in single place and make deployment as simple as possible.
## Deployment example
Grafana storj
Grafana host

List of web interfaces

storj-node stack

storj-ui stack

Portainer

*Portainer is not included in this deployment guide*
## Per node compose deployment
* storj-node with log to file
* preconfigured zksync
* logrotate for storj-node
* storj exporter
* storj log exporter
* storj updater
* running on shared dedicated internal network## Other
* docker host OS monitoring
* prometheus + grafana configuration
* grafana storj and host os monitoring graphs
* simple website for host displaying all available storj web interfaces
* storj multinode optional deployment## Tutorial
[](https://www.youtube.com/watch?v=7C2mGGZkcMk)## Credits
Implementation includes following:
* https://github.com/storj/storj
* https://github.com/anclrii/Storj-Exporter
* https://github.com/anclrii/Storj-Exporter-dashboard
* https://github.com/kevinkk525/storj-log-exporter
* https://github.com/prometheus/node_exporter
* https://github.com/rfmoz/grafana-dashboards# Prepare for deployment
This is one time step to build a docker image we will use in node deployment.## Build storj-log-exporter docker image
```
cd ~
git clone https://github.com/kevinkk525/storj-log-exporter
cd storj-log-exporter
sudo docker build -t storj-log-exporter .
```# Node deployment
Example for node "01". Increment number as needed.## Prepare storj node implementation
Get your auth token and Generate node identity as normal with name nodeXX, replace XX with node number. Example: node01
https://www.storj.io/host-a-nodeLinux example for node01:
```
cd ~
wget https://github.com/storj/storj/releases/latest/download/identity_linux_amd64.zip
unzip -o identity_linux_amd64.zip
chmod +x identity
./identity create node01
./identity authorize node01
grep -c BEGIN ~/.local/share/storj/identity/node01/ca.cert
grep -c BEGIN ~/.local/share/storj/identity/node01/identity.cert
```
*grep should result in 2 and 3 respectively.*Port forward 140XX, replace XX with node number. Example: 14001
## Initialize storj node
```
docker run --rm -e SETUP="true" \
--user $(id -u):$(id -g) \
--mount type=bind,source="/root/.local/share/storj/identity/node01",destination=/app/identity \
--mount type=bind,source="/mnt/node01",destination=/app/config \
--name storj-node01 storjlabs/storagenode:latest
```## Deploy storj node
Checkout storj-node stack for new node
```
cd ~
rm /mnt/node01/config.yaml
svn checkout https://github.com/tomaae/storj-deployment.git/trunk/storj-nodeXX storj-node01
```Edit stack configuration:
```
sed -i 's/XX/01/g' ./storj-node01/.env
```Edit storj-node01/.env attributes as needed:
```
NODE_ID=<2 number node id>
NODE_EMAIL=
NODE_EXTERNAL=:150XX
NODE_STORAGE=
NODE_WALLET=
NODE_MNT=
NODE_IDENTITY=
```
*node ID, ports and NODE_IDENTITY should be preconfigured correctly*Deploy node
```
cd storj-node01
docker compose up -d
```# Grafana deployment
One time deploymentCheckout storj-ui stack
```
cd ~
svn checkout https://github.com/tomaae/storj-deployment.git/trunk/storj-ui
```Edit stack configuration storj-ui/.env
```
PROMETHEUS_MOUNT=/prometheus
GRAFANA_MOUNT=/grafanaGF_SECURITY_ADMIN_PASSWORD=
GF_USERS_ALLOW_SIGN_UP=false
GF_INSTALL_PLUGINS=yesoreyeram-boomtable-panelDOCKER_HOST_HOSTNAME=
```Edit storj-ui/prometheus.yml, append block for each node, replace XX with node ID
```
- job_name: storj-nodeXX
scrape_interval: 60s
scrape_timeout: 20s
metrics_path: /
static_configs:
- targets: ["storj-exporterXX:9651", "storj-log-exporterXX:9144"]
labels:
instance: "nodeXX"
```Deploy storj-ui
```
cd storj-ui
docker compose up -d
```Import grafana dashboard:
https://raw.githubusercontent.com/tomaae/storj-deployment/main/storj-ui/dashboard_exporter_combined.json
# (Optional) Deploy docker host statistics
If you want docker host statistics, deploy for each docker hostCheckout storj-host stack
```
cd ~
mkdir -p /mnt/exporter/prometheus /mnt/exporter/grafana
chown 777 /mnt/exporter/prometheus /mnt/exporter/grafana
svn checkout https://github.com/tomaae/storj-deployment.git/trunk/storj-hostXX storj-host01
sed -i 's/XX/01/g' ./storj-host01/.env
cd storj-host01
docker compose up -d
```Edit storj-ui/prometheus.yml, append block for each host, replace XX with host ID
```
- job_name: storj-hostXX
static_configs:
- targets: ['host-exporterXX:9100']
labels:
instance: "hostXX"
```Deploy updated storj-ui
```
cd storj-ui
docker compose down
docker compose up -d
```Import grafana dashboard:
https://raw.githubusercontent.com/tomaae/storj-deployment/main/storj-ui/node-exporter-full.json
# (Optional) multinode deployment
One time deployment if you want to also deploy official multinodeGenerate identity for multinode:
```
cd ~
./identity create multinode --difficulty 10
```Deploy docker image:
```
docker run -d --restart unless-stopped \
--user $(id -u):$(id -g) \
-p 10000:15002/tcp \
--network storj-bridge
--mount type=bind,source="/root/.local/share/storj/identity/multinode/ca.key",destination=/app/identity \
--mount type=bind,source="/mnt/multinode",destination=/app/config \
--name storj-multinode storjlabs/multinode:latest
```Issue API key:
```
docker exec -it storj-node01 ./storagenode issue-apikey --identity-dir /app/identity --config-dir /app/config --log.output stderr
```
*Change node01 to appropriate node number*multinode UI will be available on port 10000
When importing new nodes, use internal network addresses instead of public:
```
Public IP Address:
storj-node01:28967
```