Submit Search
Upload
自宅環境:Mastodonに関するあれこれ 20170610a
•
1 like
•
733 views
Y
Yuichi Tominaga
Follow
できればLT出来たら良かったなーと思いながら、プレゼン資料作成練習のついでに作成したもの。
Read less
Read more
Technology
Report
Share
Report
Share
1 of 13
Download now
Download to read offline
Recommended
自宅環境:無償アプライアンスの活用 2017610a
自宅環境:無償アプライアンスの活用 2017610a
Yuichi Tominaga
WordPressで使われているPHPについて勉強してみた
WordPressで使われているPHPについて勉強してみた
Toshiki Tanji
私がやったWordPressの勉強法 byたにゃん
私がやったWordPressの勉強法 byたにゃん
Yuko Taniguchi
Osc16gm
Osc16gm
Net Kanayan
WordCamp Yokohama2010 プレゼン
WordCamp Yokohama2010 プレゼン
miccweb
年越しVue.jsをした話
年越しVue.jsをした話
YukiSamuraki
正規表現で楽しよう
正規表現で楽しよう
笹川 純一
ウェブ解析してみよう
ウェブ解析してみよう
笹川 純一
Recommended
自宅環境:無償アプライアンスの活用 2017610a
自宅環境:無償アプライアンスの活用 2017610a
Yuichi Tominaga
WordPressで使われているPHPについて勉強してみた
WordPressで使われているPHPについて勉強してみた
Toshiki Tanji
私がやったWordPressの勉強法 byたにゃん
私がやったWordPressの勉強法 byたにゃん
Yuko Taniguchi
Osc16gm
Osc16gm
Net Kanayan
WordCamp Yokohama2010 プレゼン
WordCamp Yokohama2010 プレゼン
miccweb
年越しVue.jsをした話
年越しVue.jsをした話
YukiSamuraki
正規表現で楽しよう
正規表現で楽しよう
笹川 純一
ウェブ解析してみよう
ウェブ解析してみよう
笹川 純一
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
More Related Content
Featured
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Featured
(20)
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
自宅環境:Mastodonに関するあれこれ 20170610a
1.
「自宅でMastodon」 について 2017/05/12 初版 2017/05/15 第二版 2017/05/19
第三版 2017/06/10 第四版
2.
自己紹介 ろーかるゆーざ(localYouser:学生時代に名付けてもう20年近くになるHNです) @localusr@social.bluecore.net
Webサイトは https://www.bluecore.net サーバやストレージを中心に設計・構築するインフラエンジニアです。 ミドルウェアの知識、Web周りの知識はどんなに勉強しても身につかない系です。 Twitterに関しては鍵っ子なのでノーコメンツ。 多分チョイと調べりゃバレますけど、いいじゃまいか。 Facebookに関しては毒吐きまくりで他人に迷惑をかけまくってるのでノーコメンツ。 多分チョイと調べりゃ(ry
3.
経緯 4Core x2CPU &HT メモリ残量も20GBある
500GBぐらいなら余裕で 供出できるなぁ リモートフォロー 連合タイムライン に魅力を感じた! リソースなら 我が家にある! しかも自宅のインスタンスと 外部の大御所インスタンスと 連携できるだとぉぅ!?
4.
当初のMastodon構成 Internet UTM(WAF) Mastodon Server(elephant/12vCPU/8GB RAM/300GB
VHD/CentOS7) Nginx(HTTPS) SSL証明書 インストール SSL証明書 インストール 証明書は格安のKing-SSLを使用 (衝撃の980円/年) Mastodon _db_1 Mastodon _redis_1 Mastodon _streaming_1 Mastodon _sidekiq_1 Mastodon _web_1 Mastodon _web_run_1 Docker
5.
Mastodonインスタンスの構築 完全に見よう見まね(まずは2vCPU/2GB RAM/80GB
VHDのVM2台で作成試行) 多分最初はmasterを導入したんだと思う。 当初、非Docker構成をしようとしたのだけど、500Errorを吐き出して動かず この時CPU使用率がめちゃ高かった(原因はredis/sidekiqがプロセス再起動を繰り返し ていた模様・・・ でも、気付かずに「このプログラムはCPUリソースが要るんだな」と誤認 だから、12vCPU/8GB RAM/300GB VHDでDocker構成にて作り直し Dockerはよう知らん!だが今度は動いた! 苦労したのは、.env.production設定 まさかのSMTP認証設定は「コメントアウトが必要」 LOCAL_HTTPSは「true」にしないと死ぬ これもまた見よう見まねで作成だったので構築Tipsは「ほぼ覚えてない」
6.
Mastodonインスタンス構築後の苦労 バージョンアップに失敗(master->1.2.2) 恐らく、mastodon:db:migrateに失敗している
ある意味イチから作り直し。Master時代のフォローアカウントとは国交断絶となり、その まま疎遠に(涙) 以降は1.3.3までちゃんとバージョンアップが正常に行えているよ。 購読不能問題に悩まされる 最近話題になってた問題。 (SubscribeService.new.callの実行) 幾つかの特定アカウントとはどうしても会話を 継続したくて、おかげ様で少しだけDockerコン ソールの扱い方とか覚えることが出来ました。 その他、cron処理なんかを敢えてhinemos経由 で実行したりなど、ジョブ実行管理のやり方を 勉強するいい素材にもなりました。
7.
WAFトラフィックの推移 Blogを通してた頃 Blogを別のWAFへ 切り替えた頃 Mastodon 通してから Mastodonのリモートフォローで、色んな情報がやり取りされてるのが分かる ⇒金かけない趣味として面白い!!(証明書はちょっとかかったけど・・)
8.
よかったこと 金かからない趣味が また一つできた Web系周りの 再勉強が出来た 友だちに会えた エンプラ機器買い揃えが元々の趣味だった そこに金の掛からない趣味がまた一つできた
かつ、「仕事とも全く関わらない趣味」であることが非常 にでかい 同様に、お金の掛からない趣味の一つ「Hinemosを使った 統合管理」とも連携させたりと、一つ一つが楽しく感じる メインの仕事がバックオフィス系のインフラ構築なので、 どうしてもWebフロント系は弱い。 SSLオフロードに対する考え方等、再勉強が出来た WAFの取扱などについても、少しだけ理解が進んだよう に思う Facebookでは繋がってるものの、疎遠になりかけてた 人との会話を再開することが出来た Mastodonを通じて、新たな人間関係が形成できたこと も要素としては大きい
9.
Mastodonインスタンス現在の苦労 外部から接続時、ホーム/連合タイムラインが動的更新されない Streaming機能が、外部ログインした場合に機能できていない
内部ログインの場合はnginxを通してるので正常に動作 外部ログインの場合はSophos UTM9を通しており、ここで問題発生 一時は単なるリバースプロキシ状態にしてみたりもしたが、解決せず。 当初調べてみたところ、なんと/api/v1/streaming が4000番ポートへ接続する必要が有ることを 理解してなかった(たっはー) サイトパスルーティングを追加して対処 しかし、その後も解決せず。(ステータスが404から401に変わっただけ) エラーログは以下のような感じ 2017:05:15-00:00:10 meiji reverseproxy: id=“0299” srcip=“<外部IP>” localip=“<我が家IP>” size=“39” user=“-” host=“<外部IP>" method="GET" statuscode="401" reason="-" extra="-" exceptions="-" time="12676" url="/api/v1/streaming/" server="elephant.bluecore.net" referer="-" cookie="remember_user_token=(省略); _mastodon_session=(省略) " set-cookie="-" ところが、nginx側のログにはこれに該当するログがaccess.logにもerror.logにも見つから ない。 そもそもremember_user_token, _mastodon_sessionという文字列が見つからない
10.
Mastodonインスタンス現在の苦労 原因は、UTMがWebsocketに対応してなかった! Streaming(4000番ポート)に対する通信はWebsocketを使用している。
Sophos UTMのWAF機能はHTTP/HTTPSにしか対応していない。 Sophos UTM側は対応する気ゼロ。でも一応モジュールだけは置いてる 以下の対応を取って改善。現在はステージング環境で使われてるよ。 Mod_wstunnelの追加 Reverseproxy設定の手動修正 UTMの再起動 https://www.bluecore.net/?p=4235#more-4235
11.
Mastodonインスタンスその後 インスタンスの作り直し DB移行が再び失敗Orz
不特定のアカウントのtootがこちらに流れ込まなくなった DB容量が6MBほど目減りしていて、移行失敗したことがほぼ明白となっていた 非Docker構成で作り直し決定!以下URLを参考にした。 http://moshbox.jp/?p=28772 (コマンドに全角文字混じってるから気をつけて) WAFに対する諦め WAFを通すとどうしても以下の不具合があることが更に分かってしまった。 UTM側のWAFが対応する気ゼロ。 WebSocket対応を手動で一々本番でやるのも少々しんどい。 WAF通すことを諦め、静的NATでルーターから出すことに。 パケットフィルタリングはちゃんとしてるよ。 証明書の終端はnginxが担うことに。
12.
Social.bluecore.netの構成 Router REDIS (2vCPU/2GB RAM) AP (4vCPU/4GB RAM) DB (2vCPU/2GB
RAM) Redis Data mastodon/live DB data Unity VSA#1 Redis live DB data BKUP Unity VSA#2 De Dupe StorOnce VSA 静的NAT/Firewall Bacula使って データバックアップ NAS間はReplication 障害時は手動F/O 構成データは片っ端か らNFS NASにデータを 配置する nginx puma sidekiq streaming SSL終端 pgsqlredis
13.
elephant.bluecore.netの構成 UTM/WAF AP/DB (2vCPU/2GB RAM) SSL終端 nginx puma sidekiq streaming SSL終端 pgsql redis /api/v1/streaming: Websocket/:
HTTPS
Download now