SPB Git

spb/findata

Public
809 B · 11 lines shellscript
1#!/bin/bash2# One-time preparation of the storage node (run ON the node). Idempotent.3set -euo pipefail4export PATH="/opt/homebrew/opt/postgresql@17/bin:/opt/homebrew/bin:$HOME/.local/bin:$PATH"5psql -h localhost -d postgres -tAc "select 1 from pg_roles where rolname='findata'" | grep -q 1 || psql -h localhost -d postgres -c "create role findata login password '$(openssl rand -hex 16)'"6psql -h localhost -d postgres -tAc "select 1 from pg_database where datname='findata'" | grep -q 1 || createdb -h localhost -O findata findata7mkdir -p ~/findata-lake ~/apps/findata/logs && chmod 700 ~/findata-lake8command -v pnpm >/dev/null || npm install -g pnpm9command -v zstd >/dev/null || brew install zstd10echo "node ready: $(hostname) — lake $HOME/findata-lake ($(df -H ~ | tail -1 | awk '{print $4}') free)"11
Files · c9b7982fc3a32c4546355ddffdf00fbdd51d2d04
Menu

Theme