Ad Widget

Collapse

TimescaleDB on Ubuntu/PSQL

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shafuq
    Junior Member
    • Oct 2024
    • 17

    #1

    TimescaleDB on Ubuntu/PSQL

    So I'm trying to setup timescaledb on my new zabbix installation:

    Zabbix 7.0 > Ubuntu > 24.04 > Server > postgresql > nginx

    I can't find anything online for this specific combination regarding zabbix7+timescaledb - Only RHEL-Based guides out there.

    From:


    The steps are:
    1A. tee /etc/yum.repos.d/timescale_timescaledb.repo <<EOL
    [timescale_timescaledb]
    name=timescale_timescaledb
    baseurl=https://packagecloud.io/timescale/timescaledb/el/$(rpm -E %{rhel})/\$basearch
    repo_gpgcheck=1
    gpgcheck=0
    enabled=1
    gpgkey=https://packagecloud.io/timescale/timescaledb/gpgkey
    sslverify=1
    sslcacert=/etc/pki/tls/certs/ca-bundle.crt
    metadata_expire=300
    EOL

    2A. dnf install timescaledb-2-postgresql-16 timescaledb-2-loader-postgresql-16

    3A. timescaledb-tune --pg-config /usr/pgsql-16/bin --max-conns=125

    4A. systemctl restart postgresql-16.service

    5A. echo "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;" | sudo -u postgres psql zabbix
    cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb/schema.sql | sudo -u zabbix psql zabbix



    From what I've gathered for Ubuntu the steps should be something like:
    1B. echo "deb https://packagecloud.io/timescale/timescaledb/ubuntu/ $(lsb_release -c -s) main" | sudo tee /etc/apt/sources.list.d/timescaledb.list

    2B. wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/timescaledb.gpg

    3B. sudo apt update

    4B. sudo apt install timescaledb-2-postgresql-16 postgresql-client-16

    5B. sudo timescaledb-tune

    6B. sudo systemctl restart postgresql

    7B. echo "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;" | sudo -u postgres psql zabbix
    cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb/schema.sql | sudo -u zabbix psql zabbix


    According to the lines above:
    - Are lines 1B+2B sufficient? The 1A part has a few extra stuff within it which 1B+2B does not.
    - Line 2A has "timescaledb-2-loader-postgresql-16" while 4B comes with "postgresql-client-16". Which should it be?
    - Should I change 5B to be the same as 3A? (should I add "--pg-config /usr/pgsql-16/bin --max-conns=125" to the end of that line)

    I hope my questions aren't too confusing. I'm just trying to implement Timescaledb to an Ubuntu installation (with best practice if possible). If there is anything else I need to know/change please do inform.

    Thanks!
    Last edited by shafuq; 04-11-2024, 09:40.
  • Answer selected by shafuq at 05-11-2024, 09:24.
    shafuq
    Junior Member
    • Oct 2024
    • 17

    After some testing I went with the following. I hope it helps!
    • echo "deb https://packagecloud.io/timescale/timescaledb/ubuntu/ $(lsb_release -c -s) main" | sudo tee /etc/apt/sources.list.d/timescaledb.list
    • wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/timescaledb.gpg
    • sudo apt update
    • sudo apt-get install timescaledb-2-postgresql-16 timescaledb-2-loader-postgresql-16
    • sudo timescaledb-tune
    • sudo systemctl restart postgresql
    • echo "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;" | sudo -u postgres psql zabbix
    • cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb/schema.sql | sudo -u zabbix psql zabbix

    (check if timescaledb extension is installed on psql db via zabbix user)
    • sudo -u zabbix psql
      • \dx

    (If you see a message in the Zabbix Server log file (/var/log/zabbix/zabbix_server.log) stating that the TimescaleDB version is too new)
    • sudo vim /etc/zabbix/zabbix_server.conf
      • AllowUnsupportedDBVersions=1
    • systemctl restart zabbix-server

    If there's any recommended changes I will update accordingly.

    PS: I'm still not sure if any settings have to be (manually) configured in the UI for all the (timescaledb compression/housekeeping) effects to take place. I personally did not touch anything there.

    Comment

    • shafuq
      Junior Member
      • Oct 2024
      • 17

      #2
      After some testing I went with the following. I hope it helps!
      • echo "deb https://packagecloud.io/timescale/timescaledb/ubuntu/ $(lsb_release -c -s) main" | sudo tee /etc/apt/sources.list.d/timescaledb.list
      • wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/timescaledb.gpg
      • sudo apt update
      • sudo apt-get install timescaledb-2-postgresql-16 timescaledb-2-loader-postgresql-16
      • sudo timescaledb-tune
      • sudo systemctl restart postgresql
      • echo "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;" | sudo -u postgres psql zabbix
      • cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb/schema.sql | sudo -u zabbix psql zabbix

      (check if timescaledb extension is installed on psql db via zabbix user)
      • sudo -u zabbix psql
        • \dx

      (If you see a message in the Zabbix Server log file (/var/log/zabbix/zabbix_server.log) stating that the TimescaleDB version is too new)
      • sudo vim /etc/zabbix/zabbix_server.conf
        • AllowUnsupportedDBVersions=1
      • systemctl restart zabbix-server

      If there's any recommended changes I will update accordingly.

      PS: I'm still not sure if any settings have to be (manually) configured in the UI for all the (timescaledb compression/housekeeping) effects to take place. I personally did not touch anything there.

      Comment

      Working...