Skip to content

how-to-install-druid-dbt-nvm-gcloud-in-compute

Published: at 上午01:30

以上為強者我同事 sean 如何在gcp 機器上面 安裝druid node.js python dbt gcloud 的經驗

druid-gcp 流程

安裝

  1. nvm

  2. nodejs

    • 使用 nvm 安裝 nodejs
    • nvm install 14 lts
    • nvm use 14
    • nvm alias default 14
  3. pip (python3 預設 3.10.12)

    • apt install python3-pip
  4. dbt (使用 1.6 會壞掉)

    • pip install dbt-core==1.7.13

    • pip install dbt-bigquery==1.7.13

    • pip install dbt-postgresql==1.7.13

    • pip3 install dbt-core==1.7.13

    • pip3 install dbt-bigquery==1.7.13

    • pip3 install dbt-postgresql==1.7.13

  5. docker

    • apt install docker.io
    • apt install docker-compose
  6. pm2

    • npm install -g pm2
  7. gcloud CLI

    • sudo apt-get update
    • sudo apt-get install -y apt-transport-https ca-certificates gnupg curl
    • echo “deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main” | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
    • gcloud auth activate-service-account —key-file=./key.json
  8. git store [極其危險 使用要慎重]

    git config —global credential.helper store

  9. apt install -y htop curl tmux neovim 可參考 如何使用neovim和安裝lazyvim

  10. vi ~/.bashrc

alias vi='nvim'
alias vim='nvim'
  1. source ~/.bashrc

  2. 安裝gradle

sudo apt update
sudo apt install openjdk-17-jdk unzip -y


wget https://services.gradle.org/distributions/gradle-8.7-bin.zip

sudo mkdir /opt/gradle
sudo unzip gradle-8.7-bin.zip -d /opt/gradle


echo 'export PATH=/opt/gradle/gradle-8.7/bin:$PATH' | sudo tee -a /etc/profile.d/gradle.sh
sudo chmod +x /etc/profile.d/gradle.sh
source /etc/profile.d/gradle.sh

verify

gradle -v

quick start with term

vim ~/.bashrc

add

alias gggg='source /etc/profile.d/gradle.sh'

source ~/.bashrc
``
  1. mysql-client cli
sudo apt install mysql-client -y

and use

mysql -h <IP> -u <USERNAME> -p
  1. redis-cli
sudo apt install redis-tools -y

test local

redis-cli ping

test remote

redis-cli -h 192.168.1.100 -p 6379

test remote if u have password

redis-cli -h 192.168.1.100 -p 6379 -a "你的密码"

and command

ping

if return PONG was success

  1. pgql
sudo apt-get install postgresql-client

connect

psql -h <主機> -U <用戶名> -d <資料庫名稱>