Postgres shared memory exceeded
I have built a HAF docker image manually from source. When running the image, I get this error:
* Starting PostgreSQL 14 database server
* Error: /usr/lib/postgresql/14/bin/pg_ctl /usr/lib/postgresql/14/bin/pg_ctl start -D /home/hived/datadir/haf_db_store/pgdata -l /var/log/postgresql/postgresql-14-main.log -s -o -c unix_socket_directories="/var/run/postgresql" -c config_file="/etc/postgresql/14/main/postgresql.conf" exited with status 1:
2023-03-09 11:46:34.140 GMT [59] LOG: skipping missing configuration file "/home/hived/datadir/haf_postgresql_conf.d/custom_postgres.conf"
2023-03-09 11:46:34.141 GMT [59] LOG: skipping missing configuration file "/home/hived/datadir/haf_postgresql_conf.d/custom_postgres.conf"
2023-03-09 11:46:34.154 UTC [59] FATAL: could not map anonymous shared memory: Cannot allocate memory
2023-03-09 11:46:34.154 UTC [59] HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory, swap space, or huge pages. To reduce the request size (currently 18105196544 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.
Here is the command I'm using inside Git Bash on Windows: winpty sh 'haf\hive\scripts\run_hived_img.sh' registry.gitlab.syncad.com/hive/haf/base_instance:base_instance-local --data-dir='path\to\datadir' --name=haf
(I know it was mentioned to run the haf script directly, but then I would have to edit the script to make it work for Windows. Let me know if that would be better than calling the hive script.)
Edited by Borislav Zlatanov