Ad Widget

Collapse

Problem with starting 2.2 zabbix-server process with fresh pgsql db

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rick-pri
    Junior Member
    • Jan 2013
    • 10

    #1

    Problem with starting 2.2 zabbix-server process with fresh pgsql db

    Hi there,

    I'm trying to get my zabbix server process to run on my brand new Ubuntu 12.04 LTS monitoring server. This is a new deploy so I thought that I would use 2.2 so that I could get to grips with it for when we migrate out 2.0 servers across.

    I have created a new postgres DB and I have run the three postgres specific schema files against the DB. I have updated the /usr/local/etc/zabbix_server.conf with the correct DB user details.

    On starting the zabbix-server process the log file records the following:

    HTML Code:
    Starting Zabbix Server. Zabbix 2.2.0 (revision 40163).
      1181:20131204:162857.187 ****** Enabled features ******
      1181:20131204:162857.187 SNMP monitoring:            NO
      1181:20131204:162857.187 IPMI monitoring:            NO
      1181:20131204:162857.187 WEB monitoring:            YES
      1181:20131204:162857.187 VMware monitoring:          NO
      1181:20131204:162857.187 Jabber notifications:       NO
      1181:20131204:162857.187 Ez Texting notifications:  YES
      1181:20131204:162857.187 ODBC:                       NO
      1181:20131204:162857.187 SSH2 support:               NO
      1181:20131204:162857.187 IPv6 support:               NO
      1181:20131204:162857.187 ******************************
      1181:20131204:162857.187 using configuration file: /usr/local/etc/zabbix_server.conf
      1181:20131204:162858.050 Cannot upgrade database: the database must correspond to version 2.0 or later. Exiting ...
    Obviously this is a new build so I don't have a 2.0 DB to upgrade. Is there something obvious that I'm missing here?
    Last edited by rick-pri; 06-12-2013, 11:32.
  • rick-pri
    Junior Member
    • Jan 2013
    • 10

    #2
    Okay, this took a little while to resolve.

    Firstly, I tried wiping out the DB and setting it up again, and as I found the first time, I couldn't direct the sql into the newly created database as the zabbix user and doing it as the postgres user with the zabbix user as the owner seemed to be causing the issues.
    (On reflection if my zabbix system user account had the same password as my db zabbix user account and I'd tried to psql from that user that might have worked, but I don't create a zabbix account that can do that.)

    Once I managed to get the zabbix user able to input the sql it worked first time. I'll outline below my exact steps.
    1. I had to make some changes to my pg_hba.conf (in /etc/postgresql/9.1/main/) which I'll post below.
      Code:
      # Database administrative login by Unix domain socket
      local   all             postgres                                peer
      # TYPE  DATABASE        USER            ADDRESS                 METHOD
      
      # "local" is for Unix domain socket connections only
      #local   all             all                                     peer
      # IPv4 local connections:
      #host    all             all             127.0.0.1/32            md5
      # IPv6 local connections:
      host    all             all             ::1/128                 md5
      # Allow replication connections from localhost, by a user with the
      # replication privilege.
      #local   replication     postgres                                peer
      #host    replication     postgres        127.0.0.1/32            md5
      #host    replication     postgres        ::1/128                 md5
      local   all             all                                     trust
      host    all             all             127.0.0.1/32            trust
    2. I then restart the database (you can just reload if you prefer)
      Code:
      $ sudo service postgresql restart
    3. I log in as the postgres user, I create the database, and then I create the user account with the database user as the owner.
      Code:
      $ sudo su - postgres
      $ psql
      $ CREATE DATABASE zabbix;
      $ CREATE USER zabbix CREATEDB PASSWORD 'my-5uper-5ecret-Pa$$w0rd';
      $ ALTER DATABASE zabbix OWNER TO zabbix;
      $ \q
      $ exit
    4. I then navigate to the zabbix postgresql folder which contains the three files that I need to run against the database and then run the three commands to set up the database
      Code:
      $ cd ~/zabbix-2.2.0/database/postgresql
      $ psql -U zabbix zabbix -W < schema.sql
      $ psql -U zabbix zabbix -W < images.sql
      $ psql -U zabbix zabbix -W < data.sql


    After all of that my issues disappeared. Mainly the error message:
    Code:
    The frontend does not match Zabbix database.
    Last edited by rick-pri; 09-12-2013, 10:54.

    Comment

    • spidernik84
      Junior Member
      • Aug 2011
      • 17

      #3
      Thanks for providing the fix. I stumbled upon the same exact issue

      Comment

      • rick-pri
        Junior Member
        • Jan 2013
        • 10

        #4
        Originally posted by spidernik84
        Thanks for providing the fix. I stumbled upon the same exact issue
        You're welcome, I hate search engine query returns being littered with questions without solutions; which is what I found with this issue.

        Comment

        Working...