Skip to content

Instantly share code, notes, and snippets.

@y-ken
y-ken / comparing-elasticsearch-yml.md
Created February 13, 2014 06:58
The differences of elasticsearch v0.99.3 and v1.0.0 configuration.

Comparering following two version of configuration.

  • elasticsearch-0.90.3-1.noarch
  • elasticsearch-1.0.0-1.noarch
$ diff -ru /etc/elasticsearch/elasticsearch.yml /etc/elasticsearch/elasticsearch.yml
--- /etc/elasticsearch/elasticsearch.yml  2013-10-15 13:31:18.458828500 +0900
+++ /etc/elasticsearch/elasticsearch.yml.rpmnew  2014-02-13 13:08:35.597739270 +0900
@@ -1,13 +1,13 @@
@y-ken
y-ken / nginx-elasticsearch-and-kibana3-proxy.conf
Last active December 27, 2015 23:49
Route Kibana-v3 and plugins of Head/bigdesk requests to ElasticSearch with authenticated user's own index with an Nginx reverse-proxy.
#
# Nginx proxy for Elasticsearch + Kibana
#
# In this setup, we are password protecting the saving of dashboards. You may
# wish to extend the password protection to all paths.
#
# Even though these paths are being called as the result of an ajax request, the
# browser will prompt for a username/password on the first request
#
# If you use this, you'll want to point config.js at http://FQDN:80/ instead of
@y-ken
y-ken / mroonga-memory.md
Created May 8, 2013 15:04
mroongaの動作が不安定になるタイミングとメモリ使用量に関係性がありそうです。

OOM-Killer発動タイミング

環境

$ cat /etc/redhat-release
CentOS release 6.4 (Final)

$ rpm -qa | grep -i -E "(oon|mecab|mysql)"|sort
groonga-libs-3.0.3-0.el6.x86_64
@y-ken
y-ken / mroonga-CREATE-TABLE-IF-NOT-EXISTS.md
Last active December 17, 2015 02:49
mroongaでも以下SQLコマンドが利用可能なようです。もし差し支えなければ、ドキュメントの追加をご検討頂けると幸いです。 http://mroonga.org/ja/docs/reference.html

CREATE TABLE IF NOT EXISTS table_name (...)形式での動作テストは以下の通りです。

環境

  • CentOS-6.4
  • MySQL-5.6.11
  • mysql-mroonga-3.03

InnoDBでの動作

@y-ken
y-ken / mysql-mroonga-3.02.md
Last active December 16, 2015 22:28
mroonga-3.03では、FULLTEXT INDEXに対するノーマライザーの指定がCOMMENTを用いて出来るようになりました。 しかし、インデックスコメント以外にも作用している挙動が見受けられます。 https://github.com/mroonga/mroonga/commit/7165b02b8e2bbab12995e3710c68d994f9308442#ha_mroonga.cpp

mysql-mroonga-3.02 での挙動

$ mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 359
Server version: 5.6.10-log MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
@y-ken
y-ken / vagrant_x86_64.txt
Created March 16, 2013 00:17
Vagrantはgemだけでなく、RPMパッケージを利用したインストールも出来るようです。 システム側のRubyバージョンに依存することなく利用できるので大変便利です。 http://y-ken.hatenablog.com/entry/2013/03/16/184732
$ rpm -qlpi vagrant_x86_64.rpm
Name : vagrant Relocations: /
Version : 1.1.0 Vendor: @localhost.localdomain
Release : 1 Build Date: Thu 14 Mar 2013 03:23:41 PM JST
Install Date: (not installed) Build Host: localhost.localdomain
Group : default Source RPM: vagrant-1.1.0-1.src.rpm
Size : 47447725 License: unknown
Signature : (none)
Packager : <@localhost.localdomain>
URL : http://example.com/no-uri-given
@y-ken
y-ken / fluentd-mixin-example.txt
Last active December 14, 2015 13:08
I'd like to support mixin for my Fluentd Plugins. But It won't work. Would you please tell me the way to work fine? (FluentdプラグインのMixin対応を行おうとしているが、期待した動作にならない訳は何故でしょうか。)
### Test Run Command(テスト実行したコマンド)
curl http://localhost:8888/test -F 'json={"message":"foo"}'
### actual logging output(実際のログ出力)
2013-03-06 00:14:53 +0900 debug.mixin: {"message":"foo"}
### expected logging output(期待したログ出力)
2013-03-06 00:14:53 +0900 debug.mixin: {"message":"foo","my_tag":"test","my_time":"2013-03-05T15:14:53Z"}
@y-ken
y-ken / nginx.conf
Last active November 19, 2019 08:11
流れに乗ってnginxのログフォーマットにLTSVを採用しました。 2013/03/05リリースのfluentd-0.10.32.gemなら標準のin_tailで、format ltsvとする事でそのまま読み込めます。 proxy先からの応答時間や送出したcookieも記録する汎用的な設定です。
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format ltsv 'domain:$host\t'
'host:$remote_addr\t'
'user:$remote_user\t'
'time:$time_local\t'
'method:$request_method\t'
'path:$request_uri\t'
@y-ken
y-ken / nginx-1.0.15-1.el6.ngx.x86_64.rpm
Last active December 14, 2015 00:08
EPELから提供されるnginx-1.0.15-3.el6.x86_64.rpmと、Nginx公式リポジトリで提供されるnginx-1.0.15-1.el6.ngx.x86_64.rpmおよびnginx-1.2.7-1.el6.ngx.x86_64.rpmの内容物を比較
# Nginx公式リポジトリ
$ rpm -qlp nginx-1.0.15-1.el6.ngx.x86_64.rpm
/etc/logrotate.d/nginx
/etc/nginx
/etc/nginx/conf.d
/etc/nginx/conf.d/default.conf
/etc/nginx/conf.d/example_ssl.conf
/etc/nginx/fastcgi_params
/etc/nginx/koi-utf
/etc/nginx/koi-win
@y-ken
y-ken / 404.html
Last active December 13, 2015 23:59
EPEL経由でNginxをインストールしたときに設置される404エラー時のHTMLです。 こちらは、Nginx公式リポジトリでは提供されていないファイルです。 設置場所は「/usr/share/nginx/html/404.html」でした。 使われ方は後述の sample.conf の通りです。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>The page is not found</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
/*<![CDATA[*/
body {
background-color: #fff;