Ad Widget

Collapse

Zabbix restore problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • motitest
    Junior Member
    • Nov 2020
    • 5

    #1

    Zabbix restore problem

    I am trying to backup Zabbix from 5.2.6 and restore it into newly installed 5.4 by following the bellow procedure. But zabbix doesn't start


    a) Create directories for backup files



    Create backup directories for binary, configuration, doc, web and database files.

    mkdir -p /opt/zabbix_backup/bin_files /opt/zabbix_backup/conf_files /opt/zabbix_backup/doc_files mkdir -p /opt/zabbix_backup/web_files /opt/zabbix_backup/db_filesb) Backup Zabbix binary, doc and conf files


    Next, copy Zabbix binary, doc and configuration files. Some files will not exits, depending on what webserver you are using (Apache or NGINX), so I will use “2>/dev/null” to ignore copy errors.

    cp -rp /etc/zabbix/zabbix_server.conf /opt/zabbix_backup/conf_files cp -rp /usr/sbin/zabbix_server /opt/zabbix_backup/bin_files cp -rp /usr/share/doc/zabbix-* /opt/zabbix_backup/doc_files cp -rp /etc/httpd/conf.d/zabbix.conf /opt/zabbix_backup/conf_files 2>/dev/null cp -rp /etc/apache2/conf-enabled/zabbix.conf /opt/zabbix_backup/conf_files 2>/dev/null cp -rp /etc/zabbix/php-fpm.conf /opt/zabbix_backup/conf_files 2>/dev/null

    c) Backup Zabbix web files (frontend)


    Backup Zabbix frontend files.

    cp -rp /usr/share/zabbix/ /opt/zabbix_backup/web_files

    a) Stop Zabbix server


    systemctl stop zabbix-serverb) Delete database and create a new one with the right permissions


    mysql -u'root' -p'rootDBpass' -e "drop database zabbix" mysql -u'root' -p'rootDBpass' -e "create database zabbix character set utf8 collate utf8_bin;" mysql -u'root' -p'rootDBpass' -e "grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbixDBpass';"c) Import database from the backup


    mysql -u'root' -p'rootDBpass' zabbix -e "set global innodb_strict_mode='OFF';" zcat /opt/zabbix_backup/db_files/zabbix_backup.sql.gz | mysql -h localhost -u'root' -p'rootDBpass' 'zabbix' mysql -u'root' -p'rootDBpass' zabbix -e "set global innodb_strict_mode='ON';"d) Remove Zabbix web and bin files


    rm -rf /usr/sbin/zabbix_server /usr/share/zabbixe) Restore files from the backup


    cp -rp /opt/zabbix_backup/conf_files/zabbix_server.conf /etc/zabbix/zabbix_server.conf cp -rp /opt/zabbix_backup/bin_files/zabbix_server /usr/sbin/zabbix_server cp -rp /opt/zabbix_backup/doc_files/zabbix-* /usr/share/doc/ cp -rp /opt/zabbix_backup/web_files/zabbix /usr/share/zabbix cp -rp /opt/zabbix_backup/conf_files/zabbix.conf /etc/httpd/conf.d/zabbix.conf 2>/dev/null cp -rp /opt/zabbix_backup/conf_files/zabbix.conf /etc/apache2/conf-enabled/zabbix.conf 2>/dev/null cp -rp /opt/zabbix_backup/conf_files/php-fpm.conf /etc/zabbix/php-fpm.conf 2>/dev/nullf) Start Zabbix server


    systemctl start zabbix-server





    ############################################


    root@ZBXP01:~# systemctl start zabbix-server
    Job for zabbix-server.service failed because the control process exited with error code.
    See "systemctl status zabbix-server.service" and "journalctl -xe" for details.
    root@ZBXP01:~# systemctl status zabbix-server.service
    ● zabbix-server.service - Zabbix Server
    Loaded: loaded (/lib/systemd/system/zabbix-server.service; enabled; vendor preset: enabled)
    Active: activating (auto-restart) (Result: exit-code) since Wed 2021-06-16 07:06:33 UTC; 7s ago
    Process: 3715 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=127)

    Jun 16 07:06:44 ZBXP01 systemd[1]: zabbix-server.service: Scheduled restart job, restart counter is at 130.
    Jun 16 07:06:44 ZBXP01 systemd[1]: Stopped Zabbix Server.
    Jun 16 07:06:44 ZBXP01 systemd[1]: Starting Zabbix Server...
    Jun 16 07:06:44 ZBXP01 zabbix_server[3728]: /usr/sbin/zabbix_server: error while loading shared libraries: libmysqlclient.so.20: c>
    Jun 16 07:06:44 ZBXP01 systemd[1]: zabbix-server.service: Control process exited, code=exited, status=127/n/a
    Jun 16 07:06:44 ZBXP01 systemd[1]: zabbix-server.service: Failed with result 'exit-code'.
    Jun 16 07:06:44 ZBXP01 systemd[1]: Failed to start Zabbix Server.

    root@vNTDACLSZBXP01:~# journalctl -xe
    Jun 16 07:06:54 vNTDACLSZBXP01 systemd[1]: zabbix-server.service: Scheduled restart job, restart counter is at 131.
    -- Subject: Automatic restarting of a unit has been scheduled
    -- Defined-By: systemd
    -- Support: http://www.ubuntu.com/support
    --
    -- Automatic restarting of the unit zabbix-server.service has been scheduled, as the result for
    -- the configured Restart= setting for the unit.
    Jun 16 07:06:54 ZBXP01 systemd[1]: Stopped Zabbix Server.
    -- Subject: A stop job for unit zabbix-server.service has finished
    -- Defined-By: systemd
    -- Support: http://www.ubuntu.com/support
    --
    -- A stop job for unit zabbix-server.service has finished.
    --
    -- The job identifier is 11421 and the job result is done.
    Jun 16 07:06:54 ZBXP01 systemd[1]: Starting Zabbix Server...
    -- Subject: A start job for unit zabbix-server.service has begun execution
    -- Defined-By: systemd
    -- Support: http://www.ubuntu.com/support
    --
    -- A start job for unit zabbix-server.service has begun execution.
    --
    -- The job identifier is 11421.
    Jun 16 07:06:54 ZBXP01 zabbix_server[3739]: /usr/sbin/zabbix_server: error while loading shared libraries: libmysqlclient.so.20: c>
    Jun 16 07:06:54 ZBXP01 systemd[1]: zabbix-server.service: Control process exited, code=exited, status=127/n/a
    -- Subject: Unit process exited
    -- Defined-By: systemd
    -- Support: http://www.ubuntu.com/support
    --
    -- An ExecStart= process belonging to unit zabbix-server.service has exited.
    --
    -- The process' exit code is 'exited' and its exit status is 127.
    Jun 16 07:06:54 vZBXP01 systemd[1]: zabbix-server.service: Failed with result 'exit-code'.
    -- Subject: Unit failed
    -- Defined-By: systemd
    -- Support: http://www.ubuntu.com/support
    --
    -- The unit zabbix-server.service has entered the 'failed' state with result 'exit-code'.
    Jun 16 07:06:54 ZBXP01 systemd[1]: Failed to start Zabbix Server.
    -- Subject: A start job for unit zabbix-server.service has failed
    -- Defined-By: systemd
    -- Support: http://www.ubuntu.com/support
    --
    -- A start job for unit zabbix-server.service has finished with a failure.
    --
    -- The job identifier is 11421 and the job result is failed.
    lines 6675-6720/6720 (END)




    I have copied "/usr/sbin/zabbix_server" file from the old server and paste the new server in the same location Where is my fault?
  • motitest
    Junior Member
    • Nov 2020
    • 5

    #2
    I dont know. How can I check? I have copied file from old server

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4806

      #3
      Jun 16 07:06:44 ZBXP01 zabbix_server[3728]: /usr/sbin/zabbix_server: error while loading shared libraries: libmysqlclient.so.20: c>
      Missing some stuff?...

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4806

        #4
        Issue is not with the zabbix_server binary, but some libraries are missing (libmysqlclient.so.20) probably......

        Comment

        Working...