VIDEOCHAT  ::   FAQ  ::   Поиск  ::   Регистрация  ::   Вход

asterisk odbc SQL Alloc Handle failed

Новичком считается только что прочитавший «Астериск - будущее телефонии»
http://asterisk.ru/knowledgebase/books
и пытающийся сделать большее

Модераторы: april22, Zavr2008

Ответить
pioner_aster
Сообщения: 42
Зарегистрирован: 19 ноя 2012, 14:14

asterisk odbc SQL Alloc Handle failed

Сообщение pioner_aster »

Здравствуйте!

Появилась проблема, которой раньше не было. Быть может подскажете решение проблемы или хотя бы причину падения соединения.
Периодически пропадает соединение с базой.
После этого астериск не может нормально функционировать, так как в базе все: cdr, peers, extensions.

В логах астериска:
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER:
[Mar 27 18:49:46] WARNING[13692] res_odbc.c: SQL Execute returned an error -1: HY000: [MySQL][ODBC 5.1 Driver][mysqld-5.1.66]Query execution was interrupted (70)
[Mar 27 18:49:46] WARNING[13692] res_odbc.c: SQL Execute error -1! Verifying connection to cdr [cdr-connector]...
[Mar 27 18:49:46] WARNING[13692] res_odbc.c: Connection is down attempting to reconnect...
[Mar 27 18:49:46] DEBUG[13692] res_odbc.c: Disconnected 0 from cdr [cdr-connector]
[Mar 27 18:49:46] DEBUG[13692] res_odbc.c: Database handle 0x7fbe4c00bee0 deallocated
[Mar 27 18:49:46] NOTICE[13692] res_odbc.c: Connecting cdr
[Mar 27 18:49:46] WARNING[13692] res_odbc.c: res_odbc: Error SQLConnect=-1 errno=2013 [unixODBC][MySQL][ODBC 5.1 Driver]Lost connection to MySQL server at 'reading initial communication
[Mar 27 18:49:46] WARNING[12550] res_odbc.c: SetConnectAttr (Txn isolation) returned an error: HY000: [MySQL][ODBC 5.1 Driver]MySQL server has gone away
[Mar 27 18:49:46] WARNING[12550] res_odbc.c: SQL Execute returned an error -1: 08S01: [MySQL][ODBC 5.1 Driver][mysqld-5.1.66]MySQL server has gone away (65)
[Mar 27 18:49:46] WARNING[12550] res_odbc.c: SQL Execute error -1! Verifying connection to proxy [proxy-connector]...
[Mar 27 18:49:46] WARNING[12550] res_odbc.c: Connection is down attempting to reconnect...
[Mar 27 18:49:46] DEBUG[12550] res_odbc.c: Disconnected 0 from proxy [proxy-connector]
[Mar 27 18:49:46] DEBUG[12550] res_odbc.c: Database handle 0x7fbe7426dd10 deallocated
[Mar 27 18:49:46] NOTICE[12550] res_odbc.c: Connecting proxy
[Mar 27 18:49:46] WARNING[12550] res_odbc.c: res_odbc: Error SQLConnect=-1 errno=2013 [unixODBC][MySQL][ODBC 5.1 Driver]Lost connection to MySQL server at 'reading initial communication
[Mar 27 18:49:46] WARNING[12550] res_odbc.c: SetConnectAttr (Txn isolation) returned an error: HY000: [MySQL][ODBC 5.1 Driver]MySQL server has gone away
[Mar 27 18:49:46] WARNING[12550] res_odbc.c: SQL Execute returned an error -1: 08S01: [MySQL][ODBC 5.1 Driver][mysqld-5.1.66]MySQL server has gone away (65)
[Mar 27 18:49:46] WARNING[12550] res_odbc.c: SQL Execute error -1! Verifying connection to asterisk [asterisk-connector]...
[Mar 27 18:49:46] WARNING[12550] res_odbc.c: Connection is down attempting to reconnect...
[Mar 27 18:49:46] DEBUG[12550] res_odbc.c: Disconnected 0 from asterisk [asterisk-connector]
[Mar 27 18:49:46] DEBUG[12550] res_odbc.c: Database handle 0x7fbe742c7610 deallocated
[Mar 27 18:49:46] NOTICE[12550] res_odbc.c: Connecting asterisk
[Mar 27 18:49:46] WARNING[12550] res_odbc.c: res_odbc: Error SQLConnect=-1 errno=2013 [unixODBC][MySQL][ODBC 5.1 Driver]Lost connection to MySQL server at 'reading initial communication
[Mar 27 18:49:46] WARNING[12550] res_config_odbc.c: SQL Alloc Handle failed!
[Mar 27 18:49:46] WARNING[12550] res_odbc.c: Connection is down attempting to reconnect...
[Mar 27 18:49:46] NOTICE[12550] res_odbc.c: Connecting proxy
[Mar 27 18:49:46] WARNING[12550] res_odbc.c: res_odbc: Error SQLConnect=-1 errno=2013 [unixODBC][MySQL][ODBC 5.1 Driver]Lost connection to MySQL server at 'reading initial communication
res_odbc.conf
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER:
[asterisk]
enabled => yes
dsn => asterisk-connector
pre-connect => yes

[proxy]
enabled => yes
dsn => proxy-connector
pre-connect => yes

[cdr]
enabled => yes
dsn => cdr-connector
pre-connect => yes
odbc.ini
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER:
[asterisk-connector]
driver = MySQL
Database = asterisk
Server = xxx.xxx.xxx.xxx
User = #user#
Password = #password#


[proxy-connector]
driver = MySQL
Database = proxy
Server = xxx.xxx.xxx.xxx
User = #user#
Password = #password#

[cdr-connector]
driver = MySQL
Database = cdr
Server = xxx.xxx.xxx.xxx
User = #user#
Password = #password#
В логах mysql_error на сервере mysql пусто.

Asterisk 1.8.18
Mysql 5.1
CentOS 6
pioner_aster
Сообщения: 42
Зарегистрирован: 19 ноя 2012, 14:14

Re: asterisk odbc SQL Alloc Handle failed

Сообщение pioner_aster »

Выставил у Mysql

Код: Выделить всё

wait_timeout=300
max_allowed_packet=500М
В res_odbc.conf добавил

Код: Выделить всё

sanitysql => select 1
idlecheck => 300
Быть может поможет...
pioner_aster
Сообщения: 42
Зарегистрирован: 19 ноя 2012, 14:14

Сообщение pioner_aster »

Не помогло. Есть идеи?
Ответить
© 2008 — 2024 Asterisk.ru
Digium, Asterisk and AsteriskNOW are registered trademarks of Digium, Inc.
Design and development by PostMet-Netzwerk GmbH