fish-404 / fish-404.github.io

blog
https://fish-404.github.io/
0 stars 0 forks source link

Run Mastodon in Centos7 (troubleshoot record) #11

Open fish-404 opened 2 years ago

fish-404 commented 2 years ago

Packages:

Some deploy guide[^6] writes clearly, but miss some packages after mastodon has upgraded to a new version.

About Node.js and Yarn:

Useful websites:

[^1]: How to Install and Use FFmpeg on CentOS 7 | Linuxize

[^2]: How to install GCC Compiler on CentOS 7 | Linuxize](https://linuxize.com/post/how-to-install-gcc-compiler-on-centos-7/)

[^3]: software installation - Can't Install build-essential on CentOS - Unix & Linux Stack Exchange

[^4]: jemalloc package will also be installed

[^5]: Require jemalloc package

[^6]: Deploying a Mastodon Instance on CentOS7 | by Grant 'Faceman' Foster | Medium

[^7]: According to the NodeSource repository, CentOS 7 (64-bit) BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+

fish-404 commented 2 years ago

Certbot https://certbot.eff.org/

Reference: https://github.com/mastodon/documentation/issues/1432

fish-404 commented 2 years ago

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

Solution:

export NODE_OPTIONS=--max_old_space_size=4096

Reference: https://stackoverflow.com/questions/38558989/node-js-heap-out-of-memory

fish-404 commented 1 year ago

PostgresSQL

Don't use yum install postgresql-server to install [^1]. Follow official guide[^2] to install.

Note:

https://rhel.pkgs.org/7/postgresql-common-x86_64/libpq5-devel-15.0-42.2PGDG.rhel7.x86_64.rpm.html

[^1]: Centos 7 default postgresql is 9.2, mastodon(v3.5.3) dependency is 9.5+ [^2]: PostgreSQL: Linux downloads (Red Hat family)

fish-404 commented 1 year ago

To Do: Learn to write a shell script to install these packages, or I have to check them every time if I migrate to a new machine. And the special pg packages installing may need a version check. If I can know the dependency requirement by shell, the whole install process maybe possiable to install automatically.