以上為強者我同事 sean 如何在gcp 機器上面 安裝druid node.js python dbt gcloud 的經驗
druid-gcp 流程
安裝
-
nvm
- 安裝 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash
- vi ~/.profile
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
- source ~/.profile
-
nodejs
- 使用 nvm 安裝 nodejs
- nvm install 14 lts
- nvm use 14
- nvm alias default 14
-
pip (python3 預設 3.10.12)
- apt install python3-pip
-
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
-
-
docker
- apt install docker.io
- apt install docker-compose
-
pm2
- npm install -g pm2
-
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
-
git store [極其危險 使用要慎重]
git config —global credential.helper store
-
apt install -y htop curl tmux neovim 可參考 如何使用neovim和安裝lazyvim
-
vi ~/.bashrc
alias vi='nvim'
alias vim='nvim'
-
source ~/.bashrc
-
安裝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
``
- mysql-client cli
sudo apt install mysql-client -y
and use
mysql -h <IP> -u <USERNAME> -p
- 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
- pgql
sudo apt-get install postgresql-client
connect
psql -h <主機> -U <用戶名> -d <資料庫名稱>