{"id":5003,"date":"2016-07-27T10:05:35","date_gmt":"2016-07-27T07:05:35","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=5003"},"modified":"2016-07-27T10:05:44","modified_gmt":"2016-07-27T07:05:44","slug":"mysql-%d0%bd%d0%b5%d0%ba%d0%be%d1%82%d0%be%d1%80%d1%8b%d0%b5-%d0%be%d1%81%d0%be%d0%b1%d0%b5%d0%bd%d0%bd%d0%be%d1%81%d1%82%d0%b8-%d1%80%d0%b0%d0%b1%d0%be%d1%82%d1%8b-%d0%b8-%d1%83%d1%81%d1%82%d0%b0","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=5003","title":{"rendered":"[mysql] \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 MEM"},"content":{"rendered":"<p><strong>MEM<\/strong> &#8211;<strong> mysql enterprice monitor.<\/strong> \u042d\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u0432\u0435\u0431-\u0430\u0434\u043c\u0438\u043d\u043a\u0430, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0430 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0431\u0430\u0437\u044b <strong>mysql<\/strong> \u0438 \u043f\u043e\u043d\u044f\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d\u0430 \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442 \u0438\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443. \u041f\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0441\u0447\u0451\u0442\u0443 \u044d\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 <strong>java<\/strong>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0433\u0440\u0435\u0431\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0438\u0437 \u0431\u0430\u0437 <strong>perfomance scheme<\/strong> \u0438 <strong>information scheme<\/strong> \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0435\u0451 \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u0432\u0438\u0434\u0435. \u0422\u0430\u043a \u0436\u0435, \u0432\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0430\u0440\u0441\u0438\u0442\u0441\u044f \u0438 \u0432\u044b\u0432\u043e\u0434 <strong>show engine innodb status<\/strong> \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<p><!--more--><\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0430\u0433\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u043e\u0442\u0435\u043a\u0430\u0435\u0442 \u0431\u0435\u0437 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0431\u0443\u0434\u0443. \u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043b\u0438\u0448\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u044e\u0430\u043d\u0441\u044b \u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0443\u0447\u0442\u0438\u0442\u0435, \u0447\u0442\u043e \u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u0443 \u043e\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 <strong>https<\/strong>, \u0438, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0441\u0430\u043c\u043e\u043f\u043e\u0434\u043f\u0438\u0441\u043d\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442, \u0442\u043e \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043b\u0438\u0431\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 <strong>keystorage<\/strong> \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043b\u0438\u0431\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a <strong>http<\/strong> (\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0442\u043e\u0436\u0435, \u0438\u0431\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <strong>http<\/strong> -&gt; <strong>https\u00a0<\/strong>\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u044d\u0442\u043e \u0432 \u0444\u0430\u0439\u043b\u0435\u00a0<strong>\/opt\/mysql\/enterprise\/monitor\/apache-tomcat\/conf\/server.xml<\/strong> \u043f\u0443\u0442\u0451\u043c \u0443\u0431\u0438\u0440\u0430\u043d\u0438\u044f \u043e\u043f\u0446\u0438\u0438 <strong>redirectPort=&#8221;18443&#8243;<\/strong>)<\/p>\n<p>\u041f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 <strong>mem<\/strong>, <strong>memlim<\/strong>, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u0431\u0430\u0437\u0443. \u041f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c:<\/p>\n<pre>mysql:(root@server) [mysql]&gt;show grants for 'mem'@'localhost';\r\n\r\n+--------------------------------------------------------------------------------------------------+\r\n| Grants for mem@localhost |\r\n+--------------------------------------------------------------------------------------------------+\r\n| GRANT SELECT, PROCESS, SHOW DATABASES, REPLICATION CLIENT, SHOW VIEW ON *.* TO 'mem'@'localhost' |\r\n| GRANT UPDATE ON `performance_schema`.`threads` TO 'mem'@'localhost' |\r\n+--------------------------------------------------------------------------------------------------+\r\n2 rows in set (0.00 sec)\r\n\r\nmysql:(root@server) [mysql]&gt;show grants for 'memlim'@'localhost';\r\n+------------------------------------------------------------------------+\r\n| Grants for memlim@localhost |\r\n+------------------------------------------------------------------------+\r\n| GRANT SELECT, SHOW DATABASES, SHOW VIEW ON *.* TO 'memlim'@'localhost' |\r\n| GRANT UPDATE ON `performance_schema`.`threads` TO 'memlim'@'localhost' |\r\n+------------------------------------------------------------------------+\r\n2 rows in set (0.00 sec)\r\n<\/pre>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e: \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0432\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043e\u043d \u0441\u0430\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a \u043d\u0435\u043c\u0443 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u0441\u044f. \u041d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0431 \u043e\u0434\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0451\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432. \u0410 \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u043e\u043d \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <strong>uuid<\/strong> \u0438 <strong>hostid<\/strong> (\u043f\u043e\u043b\u044f \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b <strong>mysql.inventory<\/strong>). \u0415\u0441\u043b\u0438 \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043e\u0434\u043d\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u043f\u043e\u043b\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e \u0441\u0440\u0435\u0434\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 (\u0430 \u0443 \u043c\u0435\u043d\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430), \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c <strong>flap&#8217;\u044b<\/strong> \u0432 \u0432\u0438\u0434\u0435 \u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440 \u0436\u0438\u0432\u043e\u0439, \u0442\u043e \u043c\u0451\u0440\u0442\u0432\u044b\u0439.<\/p>\n<p>\u041a\u0430\u043a \u0436\u0435 \u0431\u044b\u0442\u044c? \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <strong>uuid<\/strong> \u0438 <strong>hostid<\/strong>. <strong>uuid<\/strong> &#8211; \u044d\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u00a0<strong>mem<\/strong> <strong>client<\/strong> \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432 \u0431\u0430\u0437\u0443, \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u0442\u0430\u043c \u043d\u0435\u0442. <strong>hostid<\/strong> &#8211; \u044d\u0442\u043e <strong>fingerprint<\/strong> \u043e\u0442 <strong>ssh<\/strong>-\u043a\u043b\u044e\u0447\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u0435\u0436\u0430\u0442 \u0432 <strong>\/etc\/ssh\/ssh_host_[dsa|rsa].pub<\/strong>. \u0412 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u043e\u043a \u043a\u043b\u044e\u0447\u0430\u00a0<strong>ssh_host_dsa_key.pub<\/strong>. \u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0443\u0437\u043d\u0430\u0442\u044c <strong>fingerprint<\/strong> <strong>ssh<\/strong>-\u043a\u043b\u044e\u0447\u0430 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p><code>$ ssh-keygen -l -f ssh_host_dsa_key.pub<br \/>\n1024 12:fa:54:11:e3:15:44:87:e1:ab:4a:b2:4e:9e:9a:52 ssh_host_dsa_key.pub<\/code><\/p>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u043b\u0435\u0436\u0438\u0442 \u0432 \u0431\u0430\u0437\u0435:<\/p>\n<pre>&gt;select * from mysql.inventory;\r\n+--------+-------------------------------------------------------+\r\n| name   | value                                                 |\r\n+--------+-------------------------------------------------------+\r\n| uuid   | 81a44975-4739-65ae-a34c-8a4ad65bb2ca                  |\r\n| hostid | ssh:{12:fa:54:11:e3:15:44:87:e1:ab:4a:b2:4e:9e:9a:52} |\r\n+--------+-------------------------------------------------------+\r\n<\/pre>\n<p>\u0418 \u0442\u0430\u043a, \u0447\u0442\u043e \u0431\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u0441\u044f \u043e\u0442 \u0441\u0442\u0430\u0440\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043d\u0443\u0436\u043d\u043e<\/p>\n<p><span style=\"color: #ff6600;\"><em>1) \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443\u00a0mysql.inventory:<\/em><\/span><\/p>\n<p><code>mysql:(root@server) [mysql]&gt;TRUNCATE mysql.inventory;<br \/>\nQuery OK, 0 rows affected (0.04 sec)<\/code><\/p>\n<p><em><span style=\"color: #ff6600;\">2) \u043f\u0435\u0440\u0435\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c ssh-\u043a\u043b\u044e\u0447\u0438 (\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0434 Solaris):<\/span><\/em><\/p>\n<p><code># \/lib\/svc\/method\/sshd -c<\/code><\/p>\n<p><em><span style=\"color: #ff6600;\">3) \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c mem client:<\/span><\/em><\/p>\n<p><code># \/etc\/init.d\/mysql-monitor-agent restart <\/code><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0431\u044b\u0442\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MEM &#8211; mysql enterprice monitor. \u042d\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u0432\u0435\u0431-\u0430\u0434\u043c\u0438\u043d\u043a\u0430, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0430 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0431\u0430\u0437\u044b mysql \u0438 \u043f\u043e\u043d\u044f\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d\u0430 \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442 \u0438\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443. \u041f\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0441\u0447\u0451\u0442\u0443 \u044d\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 java, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0433\u0440\u0435\u0431\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0438\u0437 \u0431\u0430\u0437 perfomance scheme \u0438 information scheme \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0435\u0451 \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u0432\u0438\u0434\u0435. \u0422\u0430\u043a \u0436\u0435, \u0432\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0430\u0440\u0441\u0438\u0442\u0441\u044f \u0438 \u0432\u044b\u0432\u043e\u0434 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-5003","post","type-post","status-publish","format-standard","hentry","category-databases"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/5003","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5003"}],"version-history":[{"count":2,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/5003\/revisions"}],"predecessor-version":[{"id":5005,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/5003\/revisions\/5005"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5003"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5003"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5003"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}