Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Debian JP Projectのサーバー構成

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

Debian JP Projectのサーバー構成

Youhei SASAKI

November 16, 2026

Transcript

15 slides
  1. Debian JP Project のサーバ構成 〜 さくらの夕べ Debian ナイト 〜 佐々木洋平

    [email protected] Debian JP Project/東京エリア・関西 Debian 勉強会 2026 年 11 月 16 日 (月)
  2. Important Caveat ▶ 疑問, 質問, ツッコミ, 茶々, 大歓迎!! その場でインタラクティブにどうぞ↓ ▶

    質問は slido で受けつけるそうです. https://app.sli.do/event/24B7z1V9wdbapMSZnitx6H/live/questions • チャットだと瞬時には拾えないかもしれませんがご容赦下さい. • Zoom で挙手ボタンを押すと気がつく, かも? uwabami (Debian JP) Configuration Management of Debian JP Servers 2026/11/16 2/14
  3. About me: https://about.me/uwabami ▶ 佐々木洋平/Youhei SASAKI • 青森出身 • 関西で

    20 年弱働いた後, 現在は札幌在住 ▶ 所属: • Debian Project: Debian Maintainer • Debian JP Project 監事 ▶ 連絡先: • email: [email protected] • X(旧:Twitter): uwabami → @uwabami_frozen - あとで Connpass 直しておいて下さい • GPG Key ID: rsa4096/0x9394F354891D7E07 uwabami (Debian JP) Configuration Management of Debian JP Servers 2026/11/16 3/14
  4. Special Thanks To/大いなる感謝を 本日は我々のサーバのお話, ということで. 他, Debian Project/Debian JP Project

    を支援して下さる皆様へ感謝申し上げます uwabami (Debian JP) Configuration Management of Debian JP Servers 2026/11/16 4/14
  5. さくらインターネットさんからの支援 さくらインターネットさんからのご支援について ▶ 多大なるご好意のもと, IT コミュニティ支援の一環として Debian Project および Debian

    JP Project へご支援を頂いております. ありがとうございます. ▶ 御提供頂いているサービス 1. さくらの VPS(v4) HDD 16G TK02 - Debian JP Project で利用しているサーバ群 ← 本発表で利用している機材 2. さくらの専用サーバ PHY & さくらのウェブアクセラレータ - 現在試験運用中の Debian ミラーサーバ uwabami (Debian JP) Configuration Management of Debian JP Servers 2026/11/16 5/14
  6. 本日の話題 ▶ お話すること • Debian JP Project で運用しているサーバ群の概要 • これらのサーバ群をどう管理しているか

    ▶ お話しないこと • サーバ群の詳細、設定値、利用しているツールそのものについて • 昨年度の「さくらの夕べ Debian ナイト」での 発表 by 杉本さん、もご覧下さい - 「Debian JP Project で運用しているさくらの VPS について」 uwabami (Debian JP) Configuration Management of Debian JP Servers 2026/11/16 6/14
  7. Debian JP Project のサーバ構成 Whole Server Architecture for Debian JP

    Project • • • • db.debian.or.jp www.debian.or.jp ftp.debian.or.jp vote.debian.or.jp • • • • The Internet Nginx (proxy) rt.debian.or.jp lists.debian.or.jp svn.debian.or.jp miniconf.debian.or.jp Nginx (proxy) db00 rt00 db00 www00 list00 www00 list00 ftp00 svn00 ftp00 svn00 vote00 miniconf00 vote00 miniconf00 its00 (Virtual Machine) LXC (running) LXC (stopping) rt00 sakura00 (Virtual Machine) Configuration Repository (git)
  8. Ansible のリポジトリを clone すると… How administration works % git clone

    [email protected]:debianjp/ansible-playbooks.git . . . % cd ansible-playbooks % % cat README.md # Debian JP Project Server Admin https://bitbucket.org/debianjp/ansible-playbooks/src/master/README.md このリポジトリでは、Debian JP Projectのサーバ管理用の Ansible Playbookを管理しています。 プロジェクトメンバー向けのサーバ一覧は https://bitbucket.org/debianjp/ansible-playbooks/src/master/SERVERS.md で確認できます。 管理者向けの使い方は https://bitbucket.org/debianjp/ansible-playbooks/src/master/ADMIN.md で確認できます。 ---(C) 2022 Debian JP Project
  9. Ansible リポジトリの構成 Configuration Repository Structure * group_vars/ * group_vars/all *

    group_vars/db * group_vars/lxchosts * ansible.cfg * ssh_config * hosts * site.yml * proxy.yml * db.debian.or.jp.yml * ftp.debian.or.jp.yml * lxchosts.yml * vote.debian.or.jp.yml * www.debian.or.jp.yml * roles/ - Roleの定義 * roles/apache2/ * roles/common/ * roles/lxchost/ * roles/nginx/ * roles/openldap/ * roles/proxy/ * roles/db.debian.or.jp/ * roles/ftp.debian.or.jp/ * roles/vote.debian.or.jp/ * roles/www.debian.or.jp/ - 設定変数を入れるディレクトリ - すべてのホストに影響する変数設定 - db.debian.or.jp用の変数設定 - LXCホスト用の変数設定 - Ansibleの設定 - Ansible実行時のSSH設定 - インベントリ設定 - 全サーバ実行する playbook - リバースプロキシサーバ用の playbook - db.debian.or.jp用のplaybook - ftp.debian.or.jp (cdimage.debian.or.jp) 用のplaybook - LXCホスト用の playbook - vote.debian.or.jp用のplaybook - www.debian.or.jp用のplaybook - apache2のインストールと基本設定用 role - 全サーバ共通設定用 role - LXCホスト設定用 role - Nginxのインストールと基本設定用 role - openldapのインストールと基本設定用 role - リバースプロキシサーバ用 role - db.debian.or.jp用role - ftp.debian.or.jp用role - vote.debian.or.jp用role - www.debian.or.jp用role
  10. LXC の構成 LXC Structure Configuration group_vars/all containers: { "db.debian.or.jp": {

    "host": "its00", "upstream": "db00", "ssl": "enabled", "stream": "yes" }, "vote.debian.or.jp": { "host": "its00", "upstream": "vote00", "ssl": "enabled" }, "svn.debian.or.jp": { "host": "sakura00", "upstream": "svn00", "ssl": "enabled" }, . . . use_lxc_brdige: "true" lxc_iface: lxcbr0 lxc_address: 192.168.222.1 lxc_netmask: 255.255.255.0 lxc_network: 192.168.222.0/24 lxc_ptr_domain: 222.168.192.in-addr.arpa lxc_dhcp_range: 192.168.222.101,192.168.222.200 lxc_dhcp_max: 100 lxc_domain: lxc lxc_containers: { "db00": { "addr": "192.168.222.101", "host": "its00" }, "rt00": { "addr": "192.168.222.102", "host": "sakura00" }, "list00": { "addr": "192.168.222.103", "host": "sakura00" }, "proxy00": { "addr": "192.168.222.104", "host": "sakura00" }, "miniconf00": { "addr": "192.168.222.105", "host": "sakura00" }, "www00": { "addr": "192.168.222.106", "host": "its00" }, "ftp00": { "addr": "192.168.222.107", "host": "its00" }, "vote00": { "addr": "192.168.222.108", "host": "its00" }, "svn00": { "addr": "192.168.222.109", "host": "sakura00" }
  11. playbook の例: www.debian.or.jp Playbook (www.debian.or.jp) hosts roles/common/tasks/main.yml [www] www00 .

    . . [containers] db00 list00 www00 . . . - import_tasks: hostname.yml tags: hostname - import_tasks: resolved.yml when: inventory_hostname not in groups['containers'] tags: network - import_tasks: apt.yml tags: apt - import_tasks: base.yml tags: base - import_tasks: fail2ban.yml when: inventory_hostname not in groups['containers'] tags: fail2ban - import_tasks: ssh.yml tags: ssh - import_tasks: etckeeper.yml tags: etckeeper - import_tasks: datetime.yml when: inventory_hostname not in groups['containers'] tags: datetime - import_tasks: rsyslog.yml tags: rsyslog - import_tasks: postfix.yml tags: postfix - import_tasks: emailforward.yml when: inventory_hostname in groups['mta'] tags: emailforward - import_tasks: logcheck.yml tags: logcheck - import_tasks: sysstat.yml tags: sysstat - import_tasks: users.yml tags: users group_vars/all - name: Setup www.debian.or.jp hosts: www become: yes roles: - common - apache2 - www.debian.or.jp
  12. Debian JP Project のサーバ構成 Whole Server Architecture for Debian JP

    Project • • • • db.debian.or.jp www.debian.or.jp ftp.debian.or.jp vote.debian.or.jp • • • • The Internet Nginx (proxy) rt.debian.or.jp lists.debian.or.jp svn.debian.or.jp miniconf.debian.or.jp Nginx (proxy) db00 rt00 db00 www00 list00 www00 list00 ftp00 svn00 ftp00 svn00 vote00 miniconf00 vote00 miniconf00 its00 (Virtual Machine) LXC (running) LXC (stopping) rt00 sakura00 (Virtual Machine) Configuration Repository (git)
  13. LXC コンテナ間のバックアップ Backup Using rsync, we are performing mutual backups

    between its00 and sakura00. its00% cat /etc/cron.d/debianjp-backup 7 3 * * * root perl -e 'sleep int(rand(3600))' && \ /usr/local/libexec/debianjp/debianjp-backup backup() { local dir=$1; shift local host=$1; shift log "Start backup for $dir to $host" test -e $dir || return; ssh $host "mkdir -p /backup/`hostname -s`$dir" nice rsync $RSYNC_OPTIONS $@ $dir $host:/backup/`hostname -s`$dir log "Finish backup for $dir to $host" } for h in $HOSTS; do backup /root/ $h backup /etc/ $h backup /home/ $h backup /org/ $h backup /var/ $h \ --exclude="/cache/apt/" \ --exclude="/cache/lxc/" \ --exclude="/lib/lxcfs/" \ --exclude="/lock/" \ --exclude="/run/" \ --exclude="/tmp/" done
  14. まとめと今後に向けて ▶ 現在の Debian JP サーバ群の構成管理について • 設定値は ”role” 埋め込みではなく外部ファイルで管理する様に

    • 2 つの VM を「相互補完的」に動作させている + backup による冗長性の確保 ▶ まだまだ完璧ではなくて… • 一つのコンテナの肥大化 → 役割分離へ - 例: lists.debian.or.jp … MTA, ML(mailman3 with RDB) Thank you/感謝!! こういった構成を試せて柔軟に運用できているのも, さくらインターネットさんをはじめ とする皆様の支援のおかげです. 改めて感謝申し上げます. uwabami (Debian JP) Configuration Management of Debian JP Servers 2026/11/16 14/14

More Decks by Youhei SASAKI

Other Decks in Programming