{"id":372,"date":"2010-10-27T19:32:58","date_gmt":"2010-10-27T16:32:58","guid":{"rendered":"https:\/\/ivanosipov.ru\/?p=372"},"modified":"2014-04-02T19:07:14","modified_gmt":"2014-04-02T16:07:14","slug":"ejabberd-%d0%be%d1%82-mnesia-%d0%ba-mysql","status":"publish","type":"post","link":"https:\/\/ivanosipov.ru\/?p=372","title":{"rendered":"Ejabberd: \u043e\u0442 Mnesia \u043a MySQL"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"alignleft size-full wp-image-379\" title=\"Ejabberd\" alt=\"\" src=\"https:\/\/ivanosipov.ru\/wp-content\/uploads\/2010\/10\/Ejabberd.png\" width=\"279\" height=\"256\" \/>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 Jabber-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 \u0431\u0430\u0437\u0435 <a href=\"http:\/\/www.process-one.net\/en\/ejabberd\/\" target=\"_blank\"><strong>Ejabberd<\/strong><\/a> \u0432\u0441\u0442\u0430\u0432\u0430\u043b \u0438\u043b\u0438 \u0432\u0441\u0442\u0430\u043d\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0441 <a href=\"http:\/\/www.erlang.org\/doc\/apps\/mnesia\/\" target=\"_blank\"><strong>Mnesia<\/strong><\/a> (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0432 Ejabberd \u0421\u0423\u0411\u0414 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e) \u043d\u0430 <strong><a href=\"http:\/\/www.mysql.com\/\" target=\"_blank\">MySQL<\/a><\/strong>. \u041e\u0442 \u0441\u0435\u0431\u044f \u0445\u043e\u0447\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Ejabberd\u00a0 \u0441 <strong>ODBC<\/strong> \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u043d\u0430 \u0412\u0430\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0431\u043e\u043b\u0435\u0435 20 \u043e\u043d\u043b\u0430\u0439\u043d-\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<br \/>\n\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e, \u0447\u0442\u043e \u0443 \u0412\u0430\u0441 \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0432\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 Ejabberd \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0438 \u0433\u043e\u0442\u043e\u0432\u044b \u043a \u0440\u0430\u0431\u043e\u0442\u0435 MySQL-server, MySQL \u2013 client \u0438 <strong><a href=\"http:\/\/www.phpmyadmin.net\/home_page\/index.php\" target=\"_blank\">PHPMyAdmin<\/a><\/strong> \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430.<br \/>\n\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 2.1.0 \u0432 Ejabberd \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u0431\u0430\u0437\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u0434\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430\/\u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0432 \u0444\u0430\u0439\u043b\u044b \u0444\u043e\u0440\u043c\u0430\u0442\u0430 <strong>PIEFXIS (XEP-0227)<\/strong>. \u041e\u0434\u043d\u0430\u043a\u043e, \u0434\u0430\u043d\u043d\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u043c\u043d\u0435 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e (\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0432\u0438\u0437\u0438\u0438 exmpp, \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u043b \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0435 \u0440\u043e\u0441\u0442\u0435\u0440\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439) \u0438 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u0443 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u043e\u0434\u0443\u043b\u044f <strong>mod_ctlextra<\/strong>.<!--more--><br \/>\n\u041f\u0435\u0440\u0435\u0434 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u0432\u0441\u0435\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0438\u0436\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u043d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u044b\u0435 \u043a\u043e\u043f\u0438\u0438 Mnesia.<br \/>\n<strong>1.<\/strong> \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e, \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 (\u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0443 \u0412\u0430\u0441 \u0438\u043c\u0435\u0435\u0442\u0441\u044f):<br \/>\n<code>mkdir \/root\/src<\/code><br \/>\n\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e SVN \u043c\u043e\u0434\u0443\u043b\u0438 Ejabberd \u0432 \u0432\u0438\u0434\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432:<br \/>\n<code>cd \/root\/src<br \/>\nsvn co <a href=\"https:\/\/svn.process-one.net\/ejabberd-modules\">https:\/\/svn.process-one.net\/ejabberd-modules<\/a> ejabberd-modules<\/code><br \/>\n<strong>2.<\/strong> \u0421\u043e\u0431\u0435\u0440\u0435\u043c mod_ctlextra:<br \/>\n<code>cd \/root\/src\/ejabberd-modules\/mod_ctlextra\/trunk<br \/>\n.\/build.sh<\/code><br \/>\n\u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u043a \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c .beam Ejabberd (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \/lib\/ejabberd\/ebin):<br \/>\ncp \/root\/src\/ejabberd-modules\/mod_ctlextra\/trunk\/ebin\/mod_ctlextra.beam \/lib\/ejabberd\/ebin\/mod_ctlextra.beam<br \/>\n\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c Ejabberd \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 mod_ctlextra. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 (\/etc\/ejabberd\/ejabberd.cfg \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e) \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c:<br \/>\n<code>{modules, [<br \/>\n...<br \/>\n{mod_ctlextra, []},<br \/>\n...<br \/>\n]}.<\/code><br \/>\n\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c Ejabberd:<br \/>\n<code>\/sbin\/ejabberdctl stop<br \/>\n\/sbin\/ejabberdctl start<\/code><br \/>\n<strong>3.<\/strong> \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0434\u043b\u044f \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430:<br \/>\n<code>mkdir \/root\/ejabberdbase<\/code><br \/>\n<strong>4.<\/strong> \u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b Mnesia \u0432 \u0434\u0430\u043c\u043f\u044b \u0442\u0430\u0431\u043b\u0438\u0446 MySQL:<br \/>\n<code>ejabberdctl export2odbc domain.tld \/root\/ejabberdbase<\/code><br \/>\n\u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0432\u043c\u0435\u0441\u0442\u043e domain.tld \u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 \u0434\u043e\u043c\u0435\u043d.<br \/>\n\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0430\u043c\u043f\u044b \u0442\u0430\u0431\u043b\u0438\u0446 MySQL:<br \/>\n<code>ls \/root\/ejabberdbase<br \/>\nlast.txt<br \/>\noffline.txt<br \/>\npasswd.txt<br \/>\nprivate_storage.txt<br \/>\nroster.txt<br \/>\nvcard.txt<br \/>\nvcard_search.txt<\/code><br \/>\n<strong>5.<\/strong> \u0415\u0441\u043b\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u0412\u044b \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u043f\u0440\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043e\u043f\u0446\u0438\u044e <code>--enable-odbc<\/code> (\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0430 \u043d\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b Ejabberd \u0441 MySQL), \u0442\u043e Ejabberd \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u0442\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u044e.<br \/>\n\u0421\u043e\u0431\u0435\u0440\u0435\u043c Ejabberd \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u043e\u043f\u0446\u0438\u0435\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 ODBC:<br \/>\n<code>cd \/root\/src\/<br \/>\nwget http:\/\/www.process-one.net\/downloads\/ejabberd\/2.1.5\/ejabberd-2.1.5.tar.gz<br \/>\ntar xzvf ejabberd-2.1.5.tar.gz<br \/>\ncd \/root\/src\/ejabberd-2.1.5\/src<br \/>\n.\/configure --enable-odbc<br \/>\nmake<br \/>\nmake install<\/code><br \/>\n<strong>6. <\/strong>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 MySQL. \u042f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0434\u0440\u0430\u0439\u0432\u0435\u0440, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0440\u0438 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0443\u0442\u0435\u0447\u043a\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b \u0438 \u043e\u043d \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 SVN.<br \/>\n<code>cd \/root\/src\/ejabberd-modules\/mysql\/trunk<br \/>\n.\/build.sh<br \/>\ncp \/root\/src\/ejabberd-modules\/mysql\/trunk\/ebin\/mysql.beam \/lib\/ejabberd\/ebin\/mysql.beam<br \/>\ncp \/root\/src\/ejabberd-modules\/mysql\/trunk\/ebin\/mysql_auth.beam \/lib\/ejabberd\/ebin\/mysql_auth.beam<br \/>\ncp \/root\/src\/ejabberd-modules\/mysql\/trunk\/ebin\/mysql_conn.beam \/lib\/ejabberd\/ebin\/mysql_conn.beam<br \/>\ncp \/root\/src\/ejabberd-modules\/mysql\/trunk\/ebin\/mysql_recv.beam \/lib\/ejabberd\/ebin\/mysql_recv.beam<\/code><br \/>\n<strong> 7.<\/strong> \u0412\u0432\u043e\u0434\u0438\u043c \u043f\u0430\u0440\u043e\u043b\u044c \u0438 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c MySQL. \u0414\u0430\u043b\u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 MySQL:<br \/>\n<code>create database jabber_domain.tld;<br \/>\ngrant all privileges on jabber_domain.tld.* to jabber_domain.tld@localhost identified by '\u043f\u0430\u0440\u043e\u043b\u044c_\u0434\u043e\u0441\u0442\u0443\u043f\u0430' with grant option;<\/code><br \/>\n\u0412\u044b\u0445\u043e\u0434\u0438\u043c \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 MySQL:<br \/>\n<code>exit<\/code><br \/>\n\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043b\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0431\u0430\u0437\u044b MySQL \u0434\u043b\u044f Ejabberd (\u0434\u0430\u043c\u043f \u0432\u0445\u043e\u0434\u0438\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u043f\u043e\u0441\u0442\u0430\u0432\u043a\u0443 Ejabberd):<br \/>\n<code>mysql -uroot -p jabber_domain.tld &lt; \/root\/src\/ejabberd-2.1.5\/src\/odbc\/mysql.sql<\/code><br \/>\n<strong>8.<\/strong> \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0438\u043c\u043f\u043e\u0440\u0442\u0443 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c PHPMyAdmin. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PHPMyAdmin \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043c\u043f\u044b \u0442\u0430\u0431\u043b\u0438\u0446, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0438\u0437 Mnesia.<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td style=\"text-align: center;\" colspan=\"2\" valign=\"top\" width=\"638\"><strong>\u0421\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0434\u0430\u043c\u043f\u043e\u0432 \u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0411\u0414<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\" valign=\"top\" width=\"319\"><em>\u0422\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b<\/em><\/td>\n<td style=\"text-align: center;\" valign=\"top\" width=\"319\"><em>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0411\u0414<\/em><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\" valign=\"top\" width=\"319\">last.txt<\/td>\n<td style=\"text-align: center;\" valign=\"top\" width=\"319\">last<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\" valign=\"top\" width=\"319\">offline.txt<\/td>\n<td style=\"text-align: center;\" valign=\"top\" width=\"319\">spool<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\" valign=\"top\" width=\"319\">passwd.txt<\/td>\n<td style=\"text-align: center;\" valign=\"top\" width=\"319\">users<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\" valign=\"top\" width=\"319\">roster.txt<\/td>\n<td style=\"text-align: center;\" valign=\"top\" width=\"319\">rostetusers<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\" valign=\"top\" width=\"319\">vcard_search.txt<\/td>\n<td style=\"text-align: center;\" valign=\"top\" width=\"319\">vcard_search<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\" valign=\"top\" width=\"319\">vcard.txt<\/td>\n<td style=\"text-align: center;\" valign=\"top\" width=\"319\">vcard<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\" valign=\"top\" width=\"319\">private_storage.txt<\/td>\n<td style=\"text-align: center;\" valign=\"top\" width=\"319\">private_storage<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>9.<\/strong> \u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c Ejabberd \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 MySQL. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433 \/etc\/ejabberd\/ejabberd.cfg \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<br \/>\n\u0417\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 {auth_method, internal}. :<br \/>\n<code>%%{auth_method, internal}.<\/code><br \/>\n\u0420\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 %%{auth_method, odbc}.:<br \/>\n<code>{auth_method, odbc}.<\/code><br \/>\n\u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0431\u0430\u0437\u044b MySQL \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u043a\u0438:<br \/>\n<code>%% MySQL server:<br \/>\n%%<br \/>\n{odbc_server, {mysql, \"localhost\", \" jabber_domain.tld \", \" jabber_domain.tld \", \"\u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0430\"}}.<br \/>\n%%<br \/>\n%% If you want to specify the port:<br \/>\n%%{odbc_server, {mysql, \"server\", 1234, \"database\", \"username\", \"password\"}}.<\/code><br \/>\n\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0432\u0432\u0438\u0434\u0443, \u0447\u0442\u043e \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0432\u044f\u0437\u0438, \u0435\u0441\u043b\u0438 \u0443 \u0412\u0430\u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0445\u043e\u0441\u0442\u043e\u0432, \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u044b \u0411\u0414.<br \/>\n\u0417\u0430\u0441\u0442\u0430\u0432\u0438\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0411\u0414 MySQL. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441 _odbc \u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u044f. \u0421\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0445 ODBC \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0442\u0443\u0442 http:\/\/www.process-one.net\/en\/ejabberd\/guide_en#modoverview<br \/>\n<code>{modules, [<br \/>\n...<br \/>\n{mod_last_odbc, []},<br \/>\n{mod_offline_odbc, [{access_max_user_messages, max_user_offline_messages}]},<br \/>\n{mod_pubsub_odbc, [<br \/>\n{access_createnode, pubsub_createnode},<br \/>\n{ignore_pep_from_offline, true}, % reduces resource comsumption, but XEP incompliant<br \/>\n%%{ignore_pep_from_offline, false}, % XEP compliant, but increases resource comsumption<br \/>\n{last_item_cache, false},<br \/>\n{plugins, [\"flat\", \"hometree\", \"pep\"]} % pep requires mod_caps<br \/>\n]},<br \/>\n{mod_private_odbc, []},<br \/>\n{mod_roster_odbc, []},<br \/>\n{mod_vcard_odbc, []},<br \/>\n...<br \/>\n]}.<\/code><br \/>\n\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440.<br \/>\n\u0412\u0441\u0435. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 Mnesia \u043d\u0430 MySQL \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d \ud83d\ude42<br \/>\n\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043a\u0430\u043a \u0412\u044b \u0443\u0436\u0435 \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442 Mnesia \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043b\u044c\u0437\u044f \u0438 Ejabberd \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0421\u0423\u0411\u0414 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 Jabber-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 \u0431\u0430\u0437\u0435 Ejabberd \u0432\u0441\u0442\u0430\u0432\u0430\u043b \u0438\u043b\u0438 \u0432\u0441\u0442\u0430\u043d\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0441 Mnesia (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0432 Ejabberd \u0421\u0423\u0411\u0414 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e) \u043d\u0430 MySQL. \u041e\u0442 \u0441\u0435\u0431\u044f \u0445\u043e\u0447\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Ejabberd\u00a0 \u0441 ODBC \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u043d\u0430 \u0412\u0430\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0431\u043e\u043b\u0435\u0435 20 \u043e\u043d\u043b\u0430\u0439\u043d-\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e, \u0447\u0442\u043e \u0443 \u0412\u0430\u0441 \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0432\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[73,4],"tags":[74,86,87,88,89],"_links":{"self":[{"href":"https:\/\/ivanosipov.ru\/index.php?rest_route=\/wp\/v2\/posts\/372"}],"collection":[{"href":"https:\/\/ivanosipov.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ivanosipov.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ivanosipov.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ivanosipov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=372"}],"version-history":[{"count":4,"href":"https:\/\/ivanosipov.ru\/index.php?rest_route=\/wp\/v2\/posts\/372\/revisions"}],"predecessor-version":[{"id":597,"href":"https:\/\/ivanosipov.ru\/index.php?rest_route=\/wp\/v2\/posts\/372\/revisions\/597"}],"wp:attachment":[{"href":"https:\/\/ivanosipov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ivanosipov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ivanosipov.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}