From cb768fad74c4d743ea1320a4cbad57f0ffd737ac Mon Sep 17 00:00:00 2001 From: Alex Grin <362784+lyoshenka@users.noreply.github.com> Date: Mon, 14 Nov 2022 10:46:48 -0500 Subject: [PATCH] Updated Setting up a Hub (markdown) --- Setting-up-a-Hub.md | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/Setting-up-a-Hub.md b/Setting-up-a-Hub.md index bc3a30c..742d2b2 100644 --- a/Setting-up-a-Hub.md +++ b/Setting-up-a-Hub.md @@ -1,10 +1,12 @@ -## create an aws instance +## Server Setup + +### create an aws instance We recommend a `c5.4xlarge` instance or equivalent (16 vCPU, 32G RAM, 500GB SSD drive) (As a benchmark, on Nov 13, 2022 this setup used 350 gigs of disk space.) -## create lbry user +### create lbry user ``` sudo adduser lbry --disabled-password --gecos "" @@ -12,10 +14,10 @@ sudo -H -u lbry bash -c 'mkdir -p /home/lbry/.ssh && echo "YOUR-SSH-KEY" >> /hom sudo -H -u root bash -c 'echo "lbry ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers' ``` -## logout and log in as lbry user +### logout and log in as lbry user -## install docker +### install docker https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository @@ -35,8 +37,7 @@ sudo systemctl enable containerd.service ``` - -## create lbcd and rocksdb volumes +### create lbcd and rocksdb volumes ``` mkdir -p /home/lbry/docker-volumes/lbcd /home/lbry/docker-volumes/rocksdb @@ -46,7 +47,9 @@ docker volume create --driver local --opt type=none --opt device=/home/lbry/dock ``` -## download lbcd snapshot +## LBCD + +### download lbcd snapshot ``` sudo apt install -y zstd @@ -56,13 +59,13 @@ sudo chown -R 999:999 . cd ~ ``` -## download docker-compose.yml +### download docker-compose.yml https://github.com/lbryio/hub/wiki/docker-compose.yml __remember to remove markdown if downloading directly from that url__ -## start lbcd first and let it catch up +### start lbcd first and let it catch up ``` docker compose up -d lbcd @@ -71,7 +74,9 @@ docker compose up -d lbcd wait for it to sync fully (how will they know?) -## download scribe snapshot +## Scribe + +### download scribe snapshot ``` cd /home/lbry/docker-volumes/lbcd @@ -80,7 +85,7 @@ sudo chown -R 999:999 . cd ~ ``` -## start scribe and let it sync +### start scribe and let it sync scribe sync takes two days if you sync from scratch, or an hour or two if you use a recent snapshot @@ -90,7 +95,9 @@ docker compose up -d scribe wait for it to sync -## then start elastic sync and wait for that +## Elastic Sync + +### then start elastic sync and wait for that ``` docker compose up -d scribe_elastic_sync @@ -99,10 +106,15 @@ docker compose up -d scribe_elastic_sync wait for it to sync -## finally start herald +## Herald + +## Monitoring + +start prometheus and grafana + +do this to check that everything is working - -## federation +## Federation