Outils pour utilisateurs

Outils du site


public:a_perfect_btrfs_server

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
public:a_perfect_btrfs_server [2020/01/08 09:31] – [Update init system] pcoudercpublic:a_perfect_btrfs_server [2021/11/19 08:56] (Version actuelle) – [Initialize LXD] pcouderc
Ligne 40: Ligne 40:
 </code> </code>
  
-===== Update init system =====+===== Various inits  =====
  
-... to allow boot in case of failure of one disk of the RAID1. +I suggest to modify les logs dans /etc/systemd/journald.conf :
- +
-*** This is discussed and may be skipped : use a rescue disk in case of problem *** +
- +
-Include 'degraded' option in GRUB_CMDLINE_LINUX in /etc/grub.d/10_linux +
-<code> +
-GRUB_CMDLINE_LINUX="rootflags=degraded,subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}" +
-</code> +
-Then : +
-<code> +
-update-grub +
-grub-install /dev/sda1 +
-grub-install /dev/sdb1 +
-</code> +
-And too replace "default" options with "degraded,noatime,nodiratime,subvol=@" in btrfs line in /etc/fstab :+
 <code> <code>
-UUID=...   / btrfs   degraded,noatime,nodiratime,subvol=@    0+Storage=persistent
 </code> </code>
 +See : https://guillaume.fenollar.fr/blog/journald-tutoriel-journald-journalctl/
  
 ==== Add zram based swap ==== ==== Add zram based swap ====
Ligne 131: Ligne 118:
 <code> <code>
 lxc launch images:debian/stretch debian lxc launch images:debian/stretch debian
 +lxc config device  override debian eth0 hwaddr=02:1E:62:00:00:36 (recommended)
 +lxc config set  debian  volatile.eth0.hwaddr  00:1e:62:00:00:43 (not recommended)
 +
 lxc start debian lxc start debian
 lxc exec  debian bash lxc exec  debian bash
Ligne 137: Ligne 127:
 It is possible to choose to work as root in the containers as they are isolated from the host. It is possible to choose to work as root in the containers as they are isolated from the host.
  
-=== Backup containers LXD === +====  Containers LXD ==== 
- +=== Backup ===
-Store image :+
 <code> <code>
  
-lxc stop pgsql +lxc export pgsql /media/lxd_containers/pgsql2020_01_12.tar.gz
-lxc publish pgsql --alias pgsqlTC12 +
-lxc start pgsql +
-lxc export pgsqlTC12 . +
-mv xxxxxxx.tar.gz pgsqlYC12.tar.gz+
 </code> </code>
-Restore non testé :+After import, the container is on stopped state :
 <code> <code>
-lxc image import TARBALL --alias my-export +lxc import  /media/lxd_containers/pgsql2020_01_12.tar.gz
-lxc init my-export NEW-CONTAINER+
 </code> </code>
  
 +=== Use simple mail in server or containers ===
 +== nullmailler ==
 +Bien
 +== msmtp ==
  
-===  Without snap ===+<code> 
 +apt install msmtp msmtp-mta 
 +</code>
  
 +Et /etc/msmtprc :
  
-Without snap, to keep lxd permanent, I did reboot and create  +<code> 
- a /etc/systemd/system/lxd.service :+account default 
 +host 192.168.13.36 
 +auto_from off 
 +from container_name@couderc.eu 
 +syslog LOG_MAIL 
 +</code>
  
 +== Data access ==
 <code> <code>
-[Unit] +/var/snap/lxd/common/mntns/var/snap/lxd/common/lxd/storage-pools/default/containers/
-Description=LXD - main daemon +
-After=lxcfs.service +
-Requires=lxcfs.service +
- +
-[Service] +
-EnvironmentFile=-/etc/environment +
-ExecStartPre=/usr/lib/x86_64-linux-gnu/lxc/lxc-apparmor-load +
-ExecStart=/usr/local/bin/lxd --group sudo   --logfile=/var/log/lxd/lxd.log +
-ExecStartPost=/usr/local/bin/lxd waitready --timeout=600 +
-KillMode=process +
-TimeoutStartSec=600s +
-TimeoutStopSec=30s +
-Restart=on-failure +
-LimitNOFILE=1048576 +
-LimitNPROC=infinity +
-TasksMax=infinity +
- +
-[Install] +
-WantedBy=multi-user.target +
-Alias=lxd.service +
 </code> </code>
- 
-This service must be started. 
- 
 ===== Maintenance ===== ===== Maintenance =====
  
public/a_perfect_btrfs_server.1578475903.txt.gz · Dernière modification : 2020/01/08 09:31 de pcouderc

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki