Skip to content

Instantly share code, notes, and snippets.

View matsumana's full-sized avatar

Manabu Matsuzaki matsumana

View GitHub Profile
@matsumana
matsumana / gist:2422761
Created April 19, 2012 18:17
APサーバのFluentd設定
## built-in TCP input
## $ echo <json> | fluent-cat <tag>
<source>
type tcp
</source>
## match tag=debug.** and dump to console
<match debug.**>
type stdout
</match>
@matsumana
matsumana / gist:2422773
Created April 19, 2012 18:19
LOGサーバのFluentd設定
## built-in TCP input
## $ echo <json> | fluent-cat <tag>
<source>
type tcp
</source>
## match tag=debug.** and dump to console
<match debug.**>
type stdout
</match>
@matsumana
matsumana / gist:2422818
Created April 19, 2012 18:23
Fluentd Javaプラグインのサンプル
// $ export CLASSPATH=.:./fluent-logger-0.2.5-SNAPSHOT-jar-with-dependencies.jar
// $ javac FluentLogClient.java
// $ java FluentLogClient
import java.util.HashMap;
import java.util.Map;
import org.fluentd.logger.FluentLogger;
public class FluentLogClient {
private static FluentLogger LOG = FluentLogger.getLogger("myapp");
@matsumana
matsumana / my.cnf.master
Created October 19, 2012 17:57
MySQL5.6レプリケーションを試す
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-external-locking
key_buffer_size = 16K
max_allowed_packet = 1M
@matsumana
matsumana / my.cnf.slave01
Created October 19, 2012 17:58
MySQL5.6レプリケーションを試す
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-external-locking
key_buffer_size = 16K
max_allowed_packet = 1M
@matsumana
matsumana / my.cnf.slave02
Created October 19, 2012 17:59
MySQL5.6レプリケーションを試す
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-external-locking
key_buffer_size = 16K
max_allowed_packet = 1M
@matsumana
matsumana / mysqlfailover-health.log
Created October 19, 2012 18:01
MySQL5.6レプリケーションを試す
Replication Health Status
+-----------+-------+---------+--------+------------+---------------------------------------------------------------------------------------+---------------+-------------------+-----------------+------------+-------------+--------------+------------------+---------------+-----------+----------------+------------+---------------+
| host | port | role | state | gtid_mode | health | version | master_log_file | master_log_pos | IO_Thread | SQL_Thread | Secs_Behind | Remaining_Delay | IO_Error_Num | IO_Error | SQL_Error_Num | SQL_Error | Trans_Behind |
+-----------+-------+---------+--------+------------+---------------------------------------------------------------------------------------+---------------+-------------------+-----------------+------------+-------------+--------------+------------------+---------------+-----------+----------------+------------+---------------+
| deb
@matsumana
matsumana / mysqlfailover-failed.log
Created October 19, 2012 18:02
MySQL5.6レプリケーションを試す
Failover starting in 'auto' mode...
# Checking eligibility of slave debian01:3306 for candidate.
# GTID_MODE=ON ... Ok
# Replication user exists ... Ok
# Candidate slave debian01:3306 will become the new master.
# Preparing candidate for failover.
# LOCK STRING: FLUSH TABLES WITH READ LOCK
# Connecting candidate to debian02:3306 as a master to retrieve unprocessed GTIDs.
# Change master command for debian01:3306
# CHANGE MASTER TO MASTER_HOST = 'debian02', MASTER_USER = 'repl', MASTER_PASSWORD = '3306', MASTER_PORT = 3306, MASTER_AUTO_POSITION=1
@matsumana
matsumana / fluent_aggregate_rewrite.conf
Created November 15, 2012 11:13
Fluentdの集約サーバ用設定ファイル (fluent-plugin-rewrite版)
<source>
type forward
</source>
<match apache.access.**>
type rewrite
add_prefix rewrited
<rule>
key path
pattern \.(gif|jpe?g|png|ico|css|js)$
@matsumana
matsumana / fluent_aggregate_rewrite-tag-filter.conf
Created November 15, 2012 11:18
Fluentdの集約サーバ用設定ファイル (fluent-plugin-rewrite-tag-filter版)
<source>
type forward
</source>
<match apache.access.**>
type rewrite_tag_filter
capitalize_regex_backreference yes
rewriterule1 path \.(gif|jpe?g|png|ico|css|js)$ ignore
rewriterule2 path ^/$ rewrited.apache.access.top
rewriterule3 path ^\/([^\/]+) rewrited.apache.access.$1