生活。ちょっと古いFluentdを使っている。
docker deprecated系
dockerコマンドのうち、各種非推奨、もしくは削除された機能の一覧がこちら。
ファイル名に日付のついたログをfluentdで追っかけたかった
application.log.2016-10-12みたいなやつを追っかけたかった。tail-ex使えばよかった。というか、既に本家に組み込まれているから、標準で使えた。基本的なところじゃんか。
<source> type tail_ex path /var/log/**.log,/var/log/by-date/%Y/messages.%m/%Y%m%d tag tail_ex.*.${hostname} format /^(?<message>.*)$/ pos_file /var/tmp/fluentd.pos refresh_interval 1800 </source>
buc
ビジネスユースケース
リリースをいち早く知りたい人生だった
SlackのRSSアプリと、GitHubのRSSフィードのコンボでいけます。
GitHubのRSSフィードは、だいたいこのような形式になっており、
https://github.com/{user}/{repo_name}/releases.atom
例としてはこんな感じ。
https://github.com/akka/akka/releases.atom
で、これを、SlackのRSSにポチポチ登録していく感じ。
通知する部屋は、public/privateは問わないけど、通知に少しばかしラグがあるように思える。数分くらいかな。
giter8を試したい
試した作品
activator new
からのminimal-scalaのテンプレートに、akkaを追加したものをテンプレートとして作成しました。
giter8もろもろ
ドキュメント。インストール方法やテンプレートの書き方とかが書いてある。
テンプレート。作り方はだいたいこのあたりを見て、なぞっていけば。
他の人の作り方。結構参考になると思う。
他の人のテンプレート。参考になりました。
memo Akkaのdispatcher その2
Dispatchers — Akka Documentation
Dispatchers are responsible for scheduling all code that run inside the ActorSystem. Dispatchers are one of the most important parts of Akka.NET, as they control the throughput and time share for each of the actors, giving each one a fair share of resources.
mailbox, threadpoolの紐付けとメッセージハンドリングのロジックを行うイメージ
Akkaのシステムの中でも最も重要なところ。
Datatype Channel
- データ型に対応したチャネル
- メッセージの型を知りたい時に使うこと
The receiver knows which type of data a message contains based on the channel in which it is received.
Datatype Channel - Enterprise Integration Patterns with WSO2 ESB - WSO2 Documentation
1 つのシステム上で複数の JVM
出来る。やれる。akka cluster。なおヒープサイズとか。
network manager ubuntu
ネットワークの無線有線を管理しているマネージャー。ubuntu 16.04を使っているとたまにwifiにつながらなくなることがあって、時たまservice network-manager restart
をやる。
CoundDownLatch
スレッド処理の同期化支援と言われる。
A synchronization aid that allows one or more threads to wait until a set of operations being performed in other threads completes.
fire and forget
! means “fire-and-forget”, e.g. send a message asynchronously and return immediately. Also known as tell.
ドキュメントを読めばわかるかもですけど、メッセージを送ったらすぐにリターンする。もとはたぶん追尾ミサイルのfire and forgetで、ミサイルを発射したら、ミサイルを発射した方はミサイルの行方を知らなくても良くて、着弾点の関心事はミサイル自身が担うというアレ。
about elastic search cat api
JSON is great… for computers. Even if it’s pretty-printed, trying to find relationships in the data is tedious. Human eyes, especially when looking at an ssh terminal, need compact and aligned text. The cat API aims to meet this need. All the cat commands accept a query string parameter help to see all the headers and info they provide, and the /_cat command alone lists all the available commands.
APIのドキュメントなのにこんなにフランクでいいんですかね……
catは人間が読みやすい形(おもにJSON)に変換して返却してくれる系のAPI。なんでCATなのかは知らない。indiceはよく使います。
405 Method Not Allowed
The method specified in the Request-Line is not allowed for the resource identified by the Request-URI. The response MUST include an Allow header containing a list of valid methods for the requested resource.
POST限定なのにGETでリクエストを送ったりするとこんな感じのエラーが返ってくる。