yoku0825 / anemoeater Goto Github PK
View Code? Open in Web Editor NEWWrapper-script for box/Anemometer
Wrapper-script for box/Anemometer
現在anemoeaterを動かすのに、cpanmやDBDのインストールが必要ですが、それらもDocker上で賄うことは出来ないでしょうか。
./anemoeter /path/to/slow.log
を実行した時にmysqlが起動していないため、
https://github.com/yoku0825/anemoeater/blob/master/anemoeater#L119-L120
で接続できず、処理が進みません。
CentOS Linux release 7.4.1708
Docker version 1.13.1, build 774336d/1.13.1
perl v5.16.3
pt-tookkit 3.0.4
概要にある通り、./anemoeter /path/to/slow.log
(dockerhunのanemoeaterを利用)を実行した際に、https://github.com/yoku0825/anemoeater/blob/master/anemoeater#L119-L120
のMySQL接続部分で起動していないMySQLへの接続を待ってしまい、処理が先に進みません。
その時のdocker側のlogを確認しますと、
# docker logs e2a1674593f3
Starting MySQL (Percona Server)..... ERROR! The server quit without updating PID file (/var/lib/mysql/e2a1674593f3.pid).
とでており、MySQLが起動しきれていない状況になっていました。
Dockerfileのmysql起動部分を下記のように編集し --localオプションを利用して起動すると正常に起動することができました。
# git diff
diff --git a/Dockerfile b/Dockerfile
index 8479707..41722ab 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -13,7 +13,8 @@ RUN yum install -y Percona-Server-client-56 Percona-Server-shared-56 Percona-Ser
RUN yum install -y httpd php php-mysql php-bcmath && yum clean all
RUN git clone https://github.com/box/Anemometer.git /var/www/html/anemometer
-RUN /etc/init.d/mysql start && mysql -uroot < /var/www/html/anemometer/install.sql && mysql -uroot < /var/www/html
+RUN chown -R mysql. /var/lib/mysql && /etc/init.d/mysql start && mysql -uroot < /var/www/html/anemometer/install.s
+
RUN ln -sf /var/www/html/anemometer/conf/sample.config.inc.php /var/www/html/anemometer/conf/config.inc.php
COPY . /opt/setup
@@ -21,5 +22,5 @@ RUN patch /etc/php.ini /opt/setup/php.ini.patch
RUN patch /var/www/html/anemometer/lib/Anemometer.php /opt/setup/Anemometer.patch
EXPOSE 80
-CMD /etc/init.d/mysql start && /etc/init.d/httpd start && tail -f /dev/null
+CMD chown -R mysql. /var/lib/mysql && /etc/init.d/mysql start && /etc/init.d/httpd start && tail -f /dev/null
Suppose syntax
tcpdump -s 65535 -x -nn -q -tttt -i any -c 1000 port 3306 > mysql.tcp.txt
anemoeater --tcpdump mysql.tcp.txt
--type=tcpdump
support is implemented by #9 .
But now doesn't support to pass --watch-server
to pt-query-digest
.
So, anemoeater doesn't support tcpdump-ed file which uses port non-3306.
This issue has been reported by taka_yuki_04. Thank you!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.