使用 docker compose 部屬 Sentry

要部屬 Sentry 需要在 Linux 上並安裝 docker compose, git ,並且最少需要 2 CPU 和 4GB RAM。

拉取儲存庫:
    
git clone https://github.com/getsentry/self-hosted.git
    

切換路徑:
    
cd self-hosted/
    

執行安裝指令
    
./install.sh
    

安裝到一伴它會問你願不願意傳送資料到他們伺服器,協助分析,願意 y 不願意 n
    
Hey, so ... we would love to automatically find out about issues with your
Sentry instance so that we can improve the product. Turns out there is an app
for that, called Sentry. Would you be willing to let us automatically send data
about your instance upstream to Sentry for development and debugging purposes?

  y / yes / 1
  n / no / 0

(Btw, we send this to our own self-hosted Sentry instance, not to Sentry SaaS,
so that we can be in this together.)

Here's the info we may collect:

  - OS username
  - IP address
  - install log
  - runtime errors
  - performance data

Thirty (30) day retention. No marketing. Privacy policy at sentry.io/privacy.

y or n?
    

等待安裝...

安裝到最後會提示是否要建立帳號,這裡輸入 y 建立帳號,然後輸入 email 和兩次密碼
    
Would you like to create a user account now? [Y/n]:
    

然後就安裝完畢了,整個安裝非常久,雖然大多是在等待,總共大約過了 10 分鐘才安裝完畢。

然後就是提示使用 docker compose 指令執行:
    
docker compose up -d
    

執行完後發現場面非常壯觀,總共開啟了 55 個 docker 容器

在預設情況下是 9000 port ,假設主機 ip 是 192.168.10.2 ,就是開啟以下網址:
    
http://192.168.10.2:9000
    


假設帳號密碼有問題,我們可以使用下面的指令建立一個臨時容器,用來註冊帳號密碼:
    
docker compose run --rm web createuser
    

假設忘記密碼也可以透過建立臨時容器來更新使用者:
    
docker compose run --rm web createuser
    

執行指令:
    
sentry createuser --email [電子郵件] --password [密碼] --superuser --force-update
    



參考資料:
GitHub - getsentry/sentry
GitHub - getsentry/self-hosted

留言