NetXMS Support Forum

Please login or register.

Login with username, password and session length

Author Topic: the correct installation procedure for debian  (Read 390 times)

okoun

  • Newbie
  • *
  • Posts: 2
    • View Profile
the correct installation procedure for debian
« on: January 21, 2019, 11:13:50 am »

Hello, I have Debian 9 and I want to install netxms on a net mysql server. I use this tutorial but unfortunately I do not succeed: https://www.netxms.org/documentation/adminguide/installation.html

I will do the following:

apt-get install netxms-server
OK with problem:

Code: [Select]
Additional steps required:

1. Edit default configuration file (/etc/netxmsd.conf)

2. Load database schema (replace DBTYPE with proper name):

   nxdbmgr init /usr/share/netxms/sql/dbinit_DBTYPE.sql

   Example:

      SQLite:
        nxdbmgr init /usr/share/netxms/sql/dbinit_sqlite.sql

      PostgreSQL:
        nxdbmgr init /usr/share/netxms/sql/dbinit_pgsql.sql

      MySQL:
        nxdbmgr init /usr/share/netxms/sql/dbinit_mysql.sql

      Oracle:
        nxdbmgr init /usr/share/netxms/sql/dbinit_oracle.sql

then start daemon with command:

   service netxmsd start

Job for netxmsd.service failed because of unavailable resources or another system error.
See "systemctl status netxmsd.service" and "journalctl -xe" for details.
invoke-rc.d: initscript netxmsd, action "start" failed.
● netxmsd.service - NetXMS Server
   Loaded: loaded (/lib/systemd/system/netxmsd.service; disabled; vendor preset: enabled)
   Active: failed (Result: resources) since Mon 2019-01-21 09:46:48 CET; 19ms ago
  Process: 3731 ExecStart=/usr/bin/netxmsd -d (code=exited, status=0/SUCCESS)

led 21 09:46:48 netxms systemd[1]: Starting NetXMS Server...
led 21 09:46:48 netxms systemd[1]: netxmsd.service: PID 3732 read from file…bie.
led 21 09:46:48 netxms systemd[1]: Failed to start NetXMS Server.
led 21 09:46:48 netxms systemd[1]: netxmsd.service: Unit entered failed state.
led 21 09:46:48 netxms systemd[1]: netxmsd.service: Failed with result 'res…es'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: chyba při zpracovávání balíku netxms-server:amd64 (--configure):
 podproces instalovaný post-installation skript vrátil chybový status 1
Zpracovávají se spouštěče pro balík libc-bin (2.24-11+deb9u3) …
Zpracovávají se spouštěče pro balík ca-certificates (20161130+nmu1+deb9u1) …
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Zpracovávají se spouštěče pro balík systemd (232-25+deb9u8) …
Při zpracování nastaly chyby:
 netxms-server:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)


next I do:

apt-get install netxms-dbdrv-mysql

Code: [Select]
Načítají se seznamy balíků… Hotovo
Vytváří se strom závislostí
Načítají se stavové informace… Hotovo
Následující dodatečné balíky budou instalovány:
  libmariadbclient18 mysql-common
Navrhované balíky:
  mysql-server
Následující NOVÉ balíky budou nainstalovány:
  libmariadbclient18 mysql-common netxms-dbdrv-mysql
0 aktualizováno, 3 nově instalováno, 0 k odstranění a 0 neaktualizováno.
1 instalováno nebo odstraněno pouze částečně.
Nutno stáhnout 848 kB archivů.
Po této operaci bude na disku použito dalších 4 517 kB.
Chcete pokračovat? [Y/n] y
Stahuje se:1 http://ftp.cz.debian.org/debian stretch/main amd64 mysql-common all 5.8+1.0.2 [5 608 B]
Stahuje se:2 http://packages.netxms.org/debian stretch/main amd64 netxms-dbdrv-mysql amd64 2.2.12-1 [59,3 kB]
Stahuje se:3 http://security.debian.org/debian-security stretch/updates/main amd64 libmariadbclient18 amd64 10.1.37-0+deb9u1 [783 kB]
Staženo 848 kB za 0s (3 907 kB/s)
Vybírá se dosud nevybraný balík mysql-common.
(Načítá se databáze … nyní je nainstalováno 20684 souborů a adresářů.)
Připravuje se nahrazení …/mysql-common_5.8+1.0.2_all.deb …
Rozbaluje se mysql-common (5.8+1.0.2) …
Vybírá se dosud nevybraný balík libmariadbclient18:amd64.
Připravuje se nahrazení …/libmariadbclient18_10.1.37-0+deb9u1_amd64.deb …
Rozbaluje se libmariadbclient18:amd64 (10.1.37-0+deb9u1) …
Vybírá se dosud nevybraný balík netxms-dbdrv-mysql:amd64.
Připravuje se nahrazení …/netxms-dbdrv-mysql_2.2.12-1_amd64.deb …
Rozbaluje se netxms-dbdrv-mysql:amd64 (2.2.12-1) …
Nastavuje se balík mysql-common (5.8+1.0.2) …
update-alternatives: používám /etc/mysql/my.cnf.fallback pro poskytnutí /etc/mysql/my.cnf (my.cnf) v automatickém režimu
Nastavuje se balík libmariadbclient18:amd64 (10.1.37-0+deb9u1) …
Zpracovávají se spouštěče pro balík libc-bin (2.24-11+deb9u3) …
Nastavuje se balík netxms-dbdrv-mysql:amd64 (2.2.12-1) …
Nastavuje se balík netxms-server:amd64 (2.2.12-1) …
Job for netxmsd.service failed because of unavailable resources or another system error.
See "systemctl status netxmsd.service" and "journalctl -xe" for details.
invoke-rc.d: initscript netxmsd, action "start" failed.
● netxmsd.service - NetXMS Server
   Loaded: loaded (/lib/systemd/system/netxmsd.service; disabled; vendor preset: enabled)
   Active: failed (Result: resources) since Mon 2019-01-21 09:47:38 CET; 18ms ago
  Process: 4634 ExecStart=/usr/bin/netxmsd -d (code=exited, status=0/SUCCESS)

led 21 09:47:38 netxms systemd[1]: Starting NetXMS Server...
led 21 09:47:38 netxms systemd[1]: netxmsd.service: PID 4635 read from file /var/run/netxmsd.pid does not exist or is a zombie.
led 21 09:47:38 netxms systemd[1]: Failed to start NetXMS Server.
led 21 09:47:38 netxms systemd[1]: netxmsd.service: Unit entered failed state.
led 21 09:47:38 netxms systemd[1]: netxmsd.service: Failed with result 'resources'.
dpkg: chyba při zpracovávání balíku netxms-server:amd64 (--configure):
 podproces instalovaný post-installation skript vrátil chybový status 1
Zpracovávají se spouštěče pro balík libc-bin (2.24-11+deb9u3) …
Při zpracování nastaly chyby:
 netxms-server:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)


then edit the file netxmsd.conf And I uncomment mysql

Code: [Select]
## Logging
# Log file name
LogFile=/var/log/netxmsd

# Increase logging verbosity, 0 (only errors) to 9 (verbose debug)
#DebugLevel=3

## Database configuration.
## Uncomment and setup ONE section.

## Option #1 - SQLite (for test installations only):
#DBDriver=sqlite.ddr
#DBName=/var/lib/netxms/netxms.db

## Option #2 - PostgreSQL (recommended):
#DBDriver=pgsql.ddr
#DBServer=127.0.0.1
#DBName=netxms
#DBLogin=netxms
#DBPassword=netxms

## Option #3 - MySQL:
DBDriver=mysql.ddr
DBServer=127.0.0.1
DBName=netxms
DBLogin=netxms
DBPassword=netxms

## Option #4 - Oracle:
#DBDriver=oracle.ddr
#DBServer=//127.0.0.1:1521/ORCL # Instant Client connection string or SID
#DBLogin=netxms
#DBPassword=netxms

## Option #5 - unixODBC/FreeTDS:
#DBDriver=odbc.ddr
#DBServer=NETXMS_DSN
#DBLogin=netxms
#DBPassword=netxms


I'm still testing the command
nxdbmgr init /usr/share/netxms/sql/dbinit_mysql.sql

Code: [Select]
NetXMS Database Manager Version 2.2.12 Build 9516 (2.2.12) (UNICODE)

Unable to connect to database netxms@127.0.0.1 as netxms: Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused")


so I do not know what I'm doing badly, but it's strange that I did not ask when installing netxms-dbdrv-mysql what I want to set my name and password for?
Logged

lorenzoTarchi

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: the correct installation procedure for debian
« Reply #1 on: January 21, 2019, 01:20:00 pm »

Try to do this:
                     su
                     nxdbmgr check
                     reboot


Logged

okoun

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: the correct installation procedure for debian
« Reply #2 on: January 21, 2019, 02:20:00 pm »

Try to do this:
                     su
                     nxdbmgr check
                     reboot


Code: [Select]
root@netxms:~# nxdbmgr init /usr/share/netxms/sql/dbinit_mysql.sql
NetXMS Database Manager Version 2.2.12 Build 9516 (2.2.12) (UNICODE)

Initializing database...
SQL query failed (Specified key was too long; max key length is 767 bytes):
CREATE TABLE userdb_custom_attributes (   object_id integer not null,   attr_name varchar(255) not null,   attr_value longtext not null,   PRIMARY KEY(object_id,attr_name) )
Database initialization failed
root@netxms:~# nxdbmgr check
NetXMS Database Manager Version 2.2.12 Build 9516 (2.2.12) (UNICODE)

Unable to determine database syntax
Logged

Victor Kirhenshtein

  • Lead Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 6451
    • View Profile
Re: the correct installation procedure for debian
« Reply #3 on: January 28, 2019, 12:30:02 pm »

Hi,

this is initialization problem with some MySQL versions. Try to edit file /usr/share/netxms/sql/dbinit_mysql.sql and change

attr_name varchar(255) not null

to

attr_name varchar(63) not null

under line

CREATE TABLE userdb_custom_attributes

Best regards,
Victor
Logged