Install LXD Mosaic for Management Cluster LXD

Install LXD Mosaic untuk manajemen cluster LXD

IP address node LXD

  • LXD-1 : 192.168.88.11
  • LXD-2 : 192.168.88.12
  • LXD-3 : 192.168.88.13
  • LXD-Mosaic : 192.168.88.20

Install LXD (Linux Container) on Ubuntu 20.04

Install LXD Dashboard with LXDware

Clustering LXD (Linux Container)


  • Setting node lxd mosaic, catat trust password yang nantinya akan digunakan untuk akses dari client (lxd mosaic)
root@LXD-Mosaic:~/sys-ops.id# lxd init
Would you like to use LXD clustering? (yes/no) [default=no]: no
Do you want to configure a new storage pool? (yes/no) [default=yes]: yes
Name of the new storage pool [default=default]: sys-ops.id
Name of the storage backend to use (btrfs, dir, lvm, zfs, ceph) [default=zfs]: zfs
Create a new ZFS pool? (yes/no) [default=yes]: yes
Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no) [default=no]: no
Size in GB of the new loop device (1GB minimum) [default=7GB]: 25GB
Would you like to connect to a MAAS server? (yes/no) [default=no]: no
Would you like to create a new local network bridge? (yes/no) [default=yes]: yes
What should the new bridge be called? [default=lxdbr0]: lxdbr0
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: 10.101.10.1/24
Would you like LXD to NAT IPv4 traffic on your bridge? [default=yes]: yes
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: auto
Would you like the LXD server to be available over the network? (yes/no) [default=no]: yes
Address to bind LXD to (not including port) [default=all]: all
Port to bind LXD to [default=8443]: 8443
Trust password for new clients:
Again:
Would you like stale cached images to be updated automatically? (yes/no) [default=yes] yes
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]: no
  • Buat container ubuntu untuk LXD-Mosaic
root@LXD-Mosaic:~/sys-ops.id# lxc launch images:ubuntu/20.04/amd64 LXD-Mosaic-ct
root@LXD-Mosaic:~/sys-ops.id# lxc list
+---------------+---------+----------------------+-----------------------------------------------+-----------+-----------+
|    NAME       |  STATE  |         IPV4         |                     IPV6                      |   TYPE    | SNAPSHOTS |
+---------------+---------+----------------------+-----------------------------------------------+-----------+-----------+
| LXD-Mosaic-ct | RUNNING | 10.101.10.146 (eth0) | fd42:4cc0:7cbf:5a5a:216:3eff:feb5:f44f (eth0) | CONTAINER | 0         |
+---------------+---------+----------------------+-----------------------------------------------+-----------+-----------+
  • Masuk ke dalam bash container LXD-Mosaic
root@LXD-Mosaic:~/sys-ops.id# lxc exec LXD-Mosaic-ct bash
root@LXD-Mosaic-ct:~# hostnamectl
   Static hostname: LXD-Mosaic-ct
         Icon name: computer-container
           Chassis: container
        Machine ID: 1e81ee5a300a49979df29ea328bfa9ff
           Boot ID: b7433dc763bd4d0ba25e20288671162c
    Virtualization: lxc
  Operating System: Ubuntu 20.04.3 LTS
            Kernel: Linux 5.4.0-99-generic
      Architecture: x86-64
  • Download aplikasi LXDMosaic dari dalam container LXD-Mosaic
root@LXD-Mosaic-ct:~# curl https://raw.githubusercontent.com/turtle0x1/LxdMosaic/master/examples/install_with_clone.sh >> installLxdMosaic.sh
  • Install aplikasi LXDMosaic
root@LXD-Mosaic-ct:~# chmod +x installLxdMosaic.sh
root@LXD-Mosaic-ct:~# ./installLxdMosaic.sh
  • Jika instalasi sudah selesai akan tampil seperti beikut, lalu exit dari bash container

  • Tambahakn rule proxy port 443 untuk container LXD-Mosaic supaya bisa diakses dari network server LXD
root@LXD-Mosaic:~/sys-ops.id# lxc config device add LXD-Mosaic lxdport443 proxy listen=tcp:0.0.0.0:443 connect=tcp:127.0.0.1:443
  • Akses LXDMosaic lewat browser dengan IP address node LXD-Mosaic : https://192.168.88.20
  • Masukan IP address 192.168.88.20 dengan trust password yang dibuat saat setting lxd server (lxd init)
  • Buat user admin untuk login ke dalam LXD-Mosaic
  • Login ke dalam dashboard LXD-Mosaic
  • Tampilan dashboard LXD-Mosaic

  • Tambahkan Host cluster dengan IP anggota cluster yang sudah dibuat pada artikel sebelumnya
  • Host cluster berhasil di tambahkan

  • Tambahakn container dengan lxd mosaic

herdiana3389

A system administrator with skills in system administration, virtualization, linux, windows, networking, cloud computing, container, etc.