2. Preparation and checks before installation

By the end of this chapter: You decide yourself whether the installation files you received are intact and whether the server can run GritDB.

Time: 30 min | Run as: root for 2.1, gritdb for the rest

2.1 Create the service account

root:

useradd -m gritdb
mkdir -p /etc/systemd/logind.conf.d
printf '[Login]\nRemoveIPC=no\n' > /etc/systemd/logind.conf.d/gritdb.conf
systemctl restart systemd-logind
printf 'gritdb soft nofile 65536\ngritdb hard nofile 65536\n' >> /etc/security/limits.conf
su - gritdb

No output is normal. Lines 2 to 4 keep the shared memory of a running GritDB when gritdb logs out. Ubuntu removes it by default (Admin, chapter 1). Line 5 raises the open file limit of gritdb to 65536. The Ubuntu default is 1024 (check 7 in 2.4). Do all later work as the gritdb account.

2.2 What you need

Item Where you get it Notes
Installation file gritdb-<...>.tar.gz Distribution media 1 file
Checksum file SHA256SUMS A different channel from the installation file (such as contract documents or a separate email) If both come through the same channel, the check means nothing
jq package OS installation media or your organization’s internal repository The installation script uses it. On a network without internet access, bring it in beforehand

Put the two files in ~/pkg.

mkdir -p ~/pkg

2.3 Verify the delivered files

  1. Compare the checksum.

    cd ~/pkg
    sha256sum -c SHA256SUMS
    

    Expected output:

    gritdb-<...>.tar.gz: OK
    

    If the result is not OK, stop here and ask for the files again (GDB-INSTALL-003).

  2. Extract the archive.

    tar -xzf gritdb-*.tar.gz
    cd ~/pkg/gritdb-*/
    

    No output is normal.

  3. Verify each file. This step writes nothing to the installation directory.

    ./install_gritdb.sh --verify-only
    

    Expected output:

    [INFO] Verifying dist integrity against manifest...
    Dist verification passed (<file count> files)
    [INFO] --verify-only: done.
    

2.4 Server checklist

Run the checks in the extracted directory (~/pkg/gritdb-*/). If any item other than the minimum specification in item 5 fails, do not install.

# Check Command Normal If it fails
1 Run-as account id -un gritdb Run su - gritdb, then check again
2 jq jq --version jq-<version> Bring in the item from 2.2
3 CPU instructions ① below Two lines: cx16 and sse4_2 Cannot install — replace the server
4 glibc ② below The number at the end of line 1 ≥ the number on line 2 Cannot install — replace the OS
5 Minimum specification and memory floor nproc, free -g, and free -m nproc 16 or more, total on the Mem: line of free -g 62 or more, and total of free -m 8192 or more Below the floor (8192), you cannot install. The GritDB engine does not start. Below the minimum specification, you still get installation and operation support. Support takes performance questions after you raise the server to the minimum specification (Admin, chapter 1)
6 Disk df -h ~ Avail ≥ 200G + size of the data to load Use a separate data volume — Admin, chapters 1 and 2
7 Open file limit ulimit -n 65536 or more root runs line 5 of 2.1. Then log in again as gritdb — Admin, chapter 1
8 Port ③ below No output Find the program that uses the port. To change the port, see Admin, chapter 2
9 Shared memory removal at logout systemd-analyze cat-config systemd/logind.conf | grep -E '^RemoveIPC' RemoveIPC=no root runs lines 2 to 4 of 2.1 — Admin, chapter 1

① CPU instructions

grep -o -w -e cx16 -e sse4_2 /proc/cpuinfo | sort -u

Expected output:

cx16
sse4_2

② glibc — server version and required version

ldd --version | head -1
jq -r .min_glibc manifest.json

Expected output:

ldd (Ubuntu GLIBC <package version>) <server version>
<required version>

③ Port

ss -ltn | grep -w 5432

No output is normal. It means no program uses 5432.

  • The item 5 criterion is the GritDB subscription minimum specification (16 vCPU, 64 GB of memory). vCPU means the number of logical CPUs that the OS sees (the nproc value).
  • Even a server with 64 GB of memory shows 62 to 63 as total in free -g. The kernel and firmware reserve part of the memory. So the criterion is 62.
  • The memory floor is a total of 8192 in free -m. A server sold as 8 GB usually shows less. The kernel and firmware reserve part of the memory. Below the floor, the GritDB engine does not start, and log/GRIT_SURFER_ASSERT.log gets Required system memory >= 8192 MB.
  • The installation script sets PostgreSQL memory values (such as shared_buffers) from the server memory. So you do not need to change them on a small server either (Admin, chapter 5).
  • The item 6 criterion is installation files of about 0.5 GB + WAL up to 64 GB (max_wal_size) + tens of GB of WAL that gritsurfer_slot holds + margin.

If a problem occurs

Learn more