Malte Janduda
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Hachyderm Migration to Hetzner ## Architecture Overview ### Hetzner Servers * Freud (Intel W-2145, 128 GB RAM, 2x500G SATA Enterprise SSD) * PostgreSQL * Persistent Redis * prometheus exporters * node * postgresql * Fritz (Intel W-2145, 128 GB RAM, 2x500G SATA Consumer SSD) * mastodon-web * mastodon-streaming * nginx * Redis (no persistency, for cache) * prometheus exporters * nginx * nginxlog * node * statsd * Franz (Intel W-2145, 128 GB RAM, 2x500G SATA Consumer SSD) * sidekiq-default (16x25) (queues: default, push, pull) * sidekiq-ingress (8x75) * sidekiq-mailers (1x5) * sidekiq-scheduler (1x5) * prometheus exporters * node * statsd * Bad-Nixie (Intel W-2145, 128 GB RAM, 2x1,9T SATA Enterprise SSD) * tbd * Buttons (Intel W-2145, 128 GB RAM, 2x500G SATA SSD) - [X] Prometheus scraper - [X] prometheus exporters - [X] node - [X] Grafana ### CDN We got four servers at Linode: * cdn-frankfurt-1 - Frankfurt (EU) * cdn-fremont-1 - obviously in Fremont (rest of world) * slappy - Newark (US East, South America) * esme - (east coast?) They will cache and forward hachyderm.io traffic via tailscale to Fritz. And they will cache and forward traffic for media.hachyderm.io to Alice. We will optimize the regional coverage of the CDN nodes after everything is stable. Esme will become default and fremont will cover US west. ## Outcomes: - [ ] Alice shutdown plan in place after data is transferred to DO - [ ] Power off dot (possible) - [ ] Power off yakko (possible) - [ ] Power off wakko (possible) - [ ] The DNS records will updated entirely after this migration is complete ## Step by Step - [X] Announce downtime - [x] Yakko shutdown - [x] Shutdown Puma - `systemctl stop mastodon-web` - [x] Shutdown Streaming - `systemctl stop mastodon-streaming` - [x] Wakko shutdown - [x] Shutdown Puma - `systemctl stop mastodon-web` - [x] Shutdown Streaming - `systemctl stop mastodon-streaming` - [x] Alice: Shutdown Streaming - `systemctl stop mastodon-streaming` - [x] Wait for Queues to be 0 - [x] Dot: Shutdown Sidekiqs - [x] `for i in {1..16}; do systemctl stop mastodon-sidekiq-default@$i; done` - [x] `for i in {1..8}; do systemctl stop mastodon-sidekiq-ingress@$i; done` - [x] Alice: Shutdown Sidekiqs (scheduler + mailers) - [x] `systemctl stop mastodon-sidekiq-mailers` - [x] `systemctl stop mastodon-sidekiq-scheduler` - [x] Freud: Ensure Replication Lag is near 0s - `sudo -u postgres psql -c "select now()-pg_last_xact_replay_timestamp() as replication_lag;"` - [x] Alice: Stop Postgresql - `systemctl stop postgresql` - [x] Freud: Remove `standby.signal` file from postgres data dir - `rm /var/lib/postgres/data/standby.signal` - [x] Freud: comment out `primary_conninfo` and `hot_standby` in `/var/lib/postgres/data/postgresql.conf` - [x] Freud: Restart Postgres - `systemctl restart postgresql` - [x] Freud: Check Postgresql logs if everything is fine - [x] Franz: Install pgbouncer and configure `/etc/pgbouncer/pgbouncer.ini` - [x] Franz: Start Sidekiq Workers at Hetzner - [x] `for i in {1..16}; do systemctl start mastodon-sidekiq-default@$i; done` - [x] `for i in {1..8}; do systemctl start mastodon-sidekiq-ingress@$i; done` - [x] `systemctl start mastodon-sidekiq-mailers` - [x] `systemctl start mastodon-sidekiq-scheduler` - [x] Fritz: Start Pumas - `systemctl start mastodon-web` - [x] Fritz: Start Streaming - `systemctl start mastodon-streaming` - [x] Change CDN hachyderm.io upstream to point to Fritz - [x] cdn-fremont-1 - [x] `sed -i "s/alice/fritz/g" /etc/nginx/sites-available/hachyderm.io` - [x] `systemctl reload nginx` - [x] slappy - [x] `sed -i "s/alice/fritz/g" /etc/nginx/sites-available/hachyderm.io` - [x] `systemctl reload nginx` - [x] esme - [x] `sed -i "s/alice/fritz/g" /etc/nginx/sites-available/hachyderm.io` - [x] `systemctl reload nginx` - [ ] Enjoy ### rollback - [ ] Yakko startup - [ ] Start Puma - `systemctl start mastodon-web` - [ ] Start Streaming - `systemctl start mastodon-streaming` - [ ] Wakko startup - [ ] Start Puma - `systemctl start mastodon-web` - [ ] Start Streaming - `systemctl start mastodon-streaming` ### Current Work Status - Problem with CDN - Info errors in sidekiq ``` Dec 01 21:10:41 fritz bundle[37876]: [4c9eee37-d1c6-4e8d-806e-d606e11541b4] method=GET path=/api/v1/announcements format=html controller=Api::V1::AnnouncementsController action=index status=200 duration=22.38 view=14.02 db=4.61 Dec 01 21:10:41 fritz bundle[37897]: [5671df5c-7142-4c72-9851-c7d565ddcc21] method=GET path=/api/v1/announcements format=html controller=Api::V1::AnnouncementsController action=index status=200 duration=27.32 view=17.35 db=5.30 Dec 01 21:10:41 fritz bundle[38029]: [9ee92005-9885-4b5e-9213-73ad81e3a34f] method=GET path=/api/v1/notifications format=html controller=Api::V1::NotificationsController action=index status=200 duration=18.40 view=0.43 db=5.58 Dec 01 21:10:41 fritz bundle[38202]: [f9bfe1ca-fabc-4053-a23f-c326b94b92f5] method=GET path=/sw.js format=*/* controller=ApplicationController action=raise_not_found status=500 error='ActionView::Template::Error: Webpacker can't find common.css in /var/lib/mastodon/public/packs/manifest.json. Possible causes: Dec 01 21:10:41 fritz bundle[38202]: 1. You want to set webpacker.yml value of compile to true for your environment Dec 01 21:10:41 fritz bundle[38202]: unless you are using the `webpack -w` or the webpack-dev-server. Dec 01 21:10:41 fritz bundle[38202]: 2. webpack has not yet re-run to reflect updates. Dec 01 21:10:41 fritz bundle[38202]: 3. You have misconfigured Webpacker's config/webpacker.yml file. Dec 01 21:10:41 fritz bundle[38202]: 4. Your webpack configuration is not creating a manifest. Dec 01 21:10:41 fritz bundle[38202]: Your manifest contains: Dec 01 21:10:41 fritz bundle[38202]: { Dec 01 21:10:41 fritz bundle[38202]: } Dec 01 21:10:41 fritz bundle[38202]: ' duration=15.74 view=0.00 db=4.81 Dec 01 21:10:41 fritz bundle[38162]: [a940b4ec-04cc-48f3-9202-1b9704aa5ef1] method=GET path=/api/v1/tags/photography format=html controller=Api::V1::TagsController action=show status=200 duration=24.52 view=15.56 db=3.80 Dec 01 21:10:41 fritz bundle[38202]: [f9bfe1ca-fabc-4053-a23f-c326b94b92f5] Dec 01 21:10:41 fritz bundle[38202]: [f9bfe1ca-fabc-4053-a23f-c326b94b92f5] ActionView::Template::Error (Webpacker can't find common.css in /var/lib/mastodon/public/packs/manifest.json. Possible causes: Dec 01 21:10:41 fritz bundle[38202]: 1. You want to set webpacker.yml value of compile to true for your environment Dec 01 21:10:41 fritz bundle[38202]: unless you are using the `webpack -w` or the webpack-dev-server. Dec 01 21:10:41 fritz bundle[38202]: 2. webpack has not yet re-run to reflect updates. Dec 01 21:10:41 fritz bundle[38202]: 3. You have misconfigured Webpacker's config/webpacker.yml file. Dec 01 21:10:41 fritz bundle[38202]: 4. Your webpack configuration is not creating a manifest. Dec 01 21:10:41 fritz bundle[38202]: Your manifest contains: Dec 01 21:10:41 fritz bundle[38202]: { Dec 01 21:10:41 fritz bundle[38202]: } Dec 01 21:10:41 fritz bundle[38202]: ): Dec 01 21:10:41 fritz bundle[38202]: [f9bfe1ca-fabc-4053-a23f-c326b94b92f5] ``` ## Root Cause of Failure on mastodon-web ``` RAILS_ENV=production bundle exec rails assets:precompile RAILS_ENV=production bundle exec rails webpacker:compile export NODE_OPTIONS=--openssl-legacy-provider ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully