[Spce-user] Spce-user Digest, Vol 10, Issue 16

Alex Lutay alutay at sipwise.com
Fri Apr 17 11:50:17 EDT 2020


Hi,

Good to have "mysql failed to start" mystery solved.
We have prepared notes for documentation already.

Currently I am confused with the second part of your reply:
> ... the ngcpcfg apply script does not update the passwords in
> the respective configuration files (kamailio es).
> ...
> RESTART MARIADB <IMPORTANT OTHERWISE ngcpcfg apply fails

Please explain which password is not updated in which kamailio config
and how exactly "ngcpcfg apply" failed.

The ngcpcfg error message can help us understand why do you need to
restart MariaDB. Please share it.

I suspect, you had to perform something like "flush hosts; flush
privileges;" after "import the database" (to force MariaDB reload
changes changes you have restored). Did you?
Your MariaDB restart effectively did the missing reload.

I cannot imagine other explanation for necessity of additional DB
restart. How I see it from my side:

- new NGCP is installed from CD with NEW kamailio user password
- DB is copied from old installation, the user kamailio has OLD pass in
mysql.user, but MariaDB have nott reloaded the table yet.
- ngcpcfg apply updated all passwords to OLD values due to OLD
constants.yml and forced restarts for all services (in parallel due to
systemd).
- Kamailio cannot connect to DB using OLD password -> as DB has old
password.
- ngcpcfg has special stage "Synchronizing MySQL grants / credentials"
which happens AFTER services restart.

If all above is correct, we should consider to move "Synchronizing MySQL
grants / credentials" before all the services restart but after mariadb
(re)start. Meanwhile you can workaround the problem by using "flush
hosts; flush privileges;" after "import the database" (which is anyway
the best practice from MariaDB).

Thank you!

On 4/17/20 5:23 PM, cappellari at connectlife.it wrote:
> Ok, the problem of the MySQL ibdata file is solved, it was the mysql encription key. There remains a problem, the ngcpcfg apply script does not update the passwords in the respective configuration files (kamailio es).
> 
> The correct procedure is as follows:
> 
> copy the ngcp-config directory
> restore the mysql.encriptyon.key key on the constants.yml file
> import the database
> RESTART MARIADB <IMPORTANT OTHERWISE ngcpcfg apply fails
> run ngcpcfg apply
> 
> RESULT:
> 
> ngcp-service: info: Action restart skipped, service kannel-bearerbox is not enab led
> ngcp-service: info: Action restart skipped, service kannel-smsbox is not enabled
> ngcp-service: info: Action restart skipped, service rtpengine-recording is not and nabled
> 2020-04-14 13:04:26 sbc: Synchronizing current with expected services state
> 2020-04-14 13:04:27 sbc: Executing sync-db:
>                      rtp_interface ext = ext is sync between config and db
>                      rtp_interface int = int is sync between config and db
>                      smsc_peer default_smsc = default_smsc is sync between config and db
> 2020-04-14 13:04:27 sbc: OK
> 2020-04-14 13:04:27 sbc: Synchronizing MySQL grants / credentials
> 
> 
> 
> 
> 
> 
> 
> 
> ----- Messaggio originale -----
> Da: "spce-user-request" <spce-user-request at lists.sipwise.com>
> A: "spce-user" <spce-user at lists.sipwise.com>
> Inviato: Giovedì, 16 aprile 2020 9:35:26
> Oggetto: Spce-user Digest, Vol 10, Issue 16
> 
> Send Spce-user mailing list submissions to
> 	spce-user at lists.sipwise.com
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://lists.sipwise.com/mailman/listinfo/spce-user_lists.sipwise.com
> or, via email, send a message with subject or body 'help' to
> 	spce-user-request at lists.sipwise.com
> 
> You can reach the person managing the list at
> 	spce-user-owner at lists.sipwise.com
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Spce-user digest..."
> 
> 
> Today's Topics:
> 
>    1. Re: Spce-user Digest, Vol 10, Issue 15 (cappellari at connectlife.it)
>    2. Re: Spce-user Digest, Vol 10, Issue 15 (cappellari at connectlife.it)
>    3. Re: Spce-user Digest, Vol 10, Issue 15 (Alex Lutay)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Wed, 15 Apr 2020 20:06:19 +0200 (CEST)
> From: "cappellari at connectlife.it" <cappellari at connectlife.it>
> To: spce-user <spce-user at lists.sipwise.com>
> Subject: Re: [Spce-user] Spce-user Digest, Vol 10, Issue 15
> Message-ID:
> 	<280459404.10484.1586973979989.JavaMail.zimbra at connectlife.it>
> Content-Type: text/plain; charset=utf-8
> 
> 
> Hi, thanks for replying. I confirm that DB encryption is active. I installed sipwise on the new server from the ISO. After the installation I launched the ngcp-initial-configuration command. Then I restarted the server and replaced the ngcp-config, import db etc. Do I need to also import /etc/mysql/debian.cnf?
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ----- Messaggio originale -----
> Da: spce-user-request at lists.sipwise.com
> A: "spce-user" <spce-user at lists.sipwise.com>
> Inviato: Mercoled?, 15 aprile 2020 18:00:04
> Oggetto: Spce-user Digest, Vol 10, Issue 15
> 
> Send Spce-user mailing list submissions to
> 	spce-user at lists.sipwise.com
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://lists.sipwise.com/mailman/listinfo/spce-user_lists.sipwise.com
> or, via email, send a message with subject or body 'help' to
> 	spce-user-request at lists.sipwise.com
> 
> You can reach the person managing the list at
> 	spce-user-owner at lists.sipwise.com
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Spce-user digest..."
> 
> 
> Today's Topics:
> 
>    1. Re: Move Sipwise 8.3.1 to another server (Alex Lutay)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Tue, 14 Apr 2020 22:37:50 +0200
> From: Alex Lutay <alutay at sipwise.com>
> To: spce-user at lists.sipwise.com
> Subject: Re: [Spce-user] Move Sipwise 8.3.1 to another server
> Message-ID: <9d803207-0125-01cd-20da-31860e584886 at sipwise.com>
> Content-Type: text/plain; charset=utf-8
> 
> Hi all,
> 
> re: /etc/mysql/sipwise.cnf
> 
> mr8.3.1 doesn't operate with /etc/mysql/sipwise.cnf
> It was deprecated and removed in mr8.1.1+:
> 
>> https://www.sipwise.com/doc/mr8.1.1/spce/?_href=ar01s14.html
>> Deprecated and removed /etc/mysql/sipwise.cnf, please use /etc/mysql/sipwise_extra.cnf [TT#68021] 
> 
> Anyway both those files are generated from templates in a modern release
> ~mr6.5+, so no need to copy it manually.
> Please report if you still see in a modern documentation:
> 
>> The system configuration files such as /etc/mysql/sipwise.cnf and the
>> /etc/ngcp-config/ directory should be included in the backup
> 
> On my side:
> 
>> 22:36:27 ? taurus:(master)~/sipwise/git/documentation$ ack "sipwise.cnf"
>> debian/changelog
>> 67:  * [80136c1] TT#68021 Add remark about Deprecated /etc/mysql/sipwise.cnf to mr8.1 release notes
>> 68:  * [736174d] TT#68035 Remove /etc/mysql/sipwise.cnf from documentation
>> 22:36:30 ? taurus:(master)~/sipwise/git/documentation$ 
> 
> ============
> 
> re: mysql start issue
> 
> Good to check mysql error log: /var/log/mysql/error.log
> also systemd can print something to /var/log/syslog
> 
> Maybe it is somehow related to DB encryption, is it enabled for
> your installation? It is enabled by default for mr8.3.1:
> 
>> root at spce:~# grep crypt /etc/mysql/my.cnf 
>> # Encryption options
>> innodb_encrypt_tables             = force
>> innodb_encrypt_log                = 1
>> encrypt_binlog                    = 1
>> innodb_encryption_threads         = 1
>> innodb_tablespaces_encryption
>> root at spce:~# 
> 
> Or there could be the issue with credential in /etc/mysql/debian.cnf for
> user debian-sys-maint.
> 
> Please share your findings.
> 
> On 4/14/20 12:12 PM, Robert Cuaresma wrote:
>> On the Handbook:
>>
>> ? System configuration
>>
>> The system configuration files such as /etc/mysql/sipwise.cnf and the
>> /etc/ngcp-config/ directory should be included in the backup
>> Is it possible that you didn?t copy /etc/mysql/sipwise.cnf?
>>
>> Saludos,
>>
>> Robert Cuaresma
>>
>> ?
>>
>> *De:* cappellari at connectlife.it <cappellari at connectlife.it>
>> *Enviado el:* martes, 14 de abril de 2020 12:06
>> *Para:* spce-user at lists.sipwise.com
>> *Asunto:* [Spce-user] Move Sipwise 8.3.1 to another server
>>
>> ?
>>
>> Hello everyone! I need to move a sipwise installation to another server.
>> I copied the ngcp-config folder to the new server, exported the DB with
>> mysqldump and reimported to the new server, applied the configuration
>> with ngcpcfg apply. Everything works, but when I restart the server the
>> mysql service does not start, as a consequence also the kamailio proxy
>> and dependent services. I need to delete the idbdata file from /
>> ngcp-data / mysql to restart mysql. It looks like an innodb corruption
>> issue. Some advice?
>>
> 
> 

-- 
Alex Lutay
Vice President Development
Sipwise GmbH | an ALE Company
Europaring F15 | 2345 Brunn am Gebirge

Office: +43 1 30120436
Email: alutay at sipwise.com
Website: https://www.sipwise.com

Particulars according Austrian Companies Code paragraph 14
"Sipwise GmbH“ - Europaring F15 – 2345 Brunn am Gebirge
FN:305595f, Commercial Court Wr. Neustadt, ATU64002206



More information about the Spce-user mailing list