문서의 이전 판입니다!
php-bcmath
패키지 필요./etc/php.ini
에 date.timezone = Asia/Seoul
설정 필요.pt-query-digest --user=anemometer --password=superSecurePass \ --review h=db.example.com,D=slow_query_log,t=global_query_review \ --history h=db.example.com,D=slow_query_log,t=global_query_review_history \ --no-report --limit=0% \ --filter=" \$event->{Bytes} = length(\$event->{arg}) and \$event->{hostname}=\"$HOSTNAME\"" \ slow_query_log_file.log
$HOSTNAME
부분은 분석대상 쿼리의 호스트이름을 넣어주면 global_query_review_history.hostname_max
컬럼에 hostname 값으로 입력이 되게 되며 검색 조건으로 해당 hostname을 지정할 수 있게 된다.slow_query_log_file.log
를 자신의 Slow query log 파일로 변경한다.–review-history
였지만, 2.2.1 버전에서는 –history
로 옵션이 바뀐 것 같음.php-fpm
패키지 설치./etc/nginx/fastcgi_params
파일이 생성된다.$document_root
, $fastcgi_script_name
변수들을 찍어보고 비교해 본다. 보통은 root
,alias
등의 경로 지정이 잘못돼서 안 되는 경험을 했다.php-fpm
설정에서, user
와 group
이 실제 PHP 파일들이 있는 디렉토리와 파일에 대한 권한과 동일하도록 변경해야 한다./var/www/html/anemometer
에 설치했다고 할 때,server { listen 80; server_name example.com; location /anemometer { root /var/www/html; index index.html index.htm; } # *.php 파일만 php-fpm 이 처리한다. location ~ ^/anemometer/.+\.php$ { root /var/www/html; index index.html index.htm; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; } }