суббота, 21 декабря 2019 г.

Установка lxd на Ubuntu 19.10 server

$ sudo apt-get install bridge-utils -y
$ sudo nano  /etc/netplan/50-cloud-init.yaml

network:
  version: 2
  ethernets:
    enp0s3:
      dhcp4: no
      dhcp6: no
  bridges:
    br0:
      interfaces: [enp0s3]
      addresses: [192.168.1.247/24]
      gateway4: 192.168.1.1
      mtu: 1500
      nameservers:
        addresses: [8.8.8.8]
      parameters:
        stp: true
        forward-delay: 4
      dhcp4: no
      dhcp6: no

Сохранить.

$ sudo netplan generate
$ sudo netplan --debug apply

$ nano tuning.sh

#!/bin/bash
# отключим ipv6
sudo /bin/su -c "echo 'net.ipv6.conf.all.disable_ipv6 = 1' >> /etc/sysctl.conf"
sudo /bin/su -c "echo 'net.ipv6.conf.default.disable_ipv6 = 1' >> /etc/sysctl.conf"
sudo /bin/su -c "echo 'net.ipv6.conf.lo.disable_ipv6 = 1' >> /etc/sysctl.conf"
sudo /bin/su -c "echo '#net.ipv4.ip_forward = 1' >> /etc/sysctl.conf"
#тюнинг postgresql
sudo /bin/su -c "echo 'vm.swappiness=1' >> /etc/sysctl.conf"
sudo /bin/su -c "echo 'kernel.sched_migration_cost_ns = 5000000' >> /etc/sysctl.conf"
sudo /bin/su -c "echo 'kernel.sched_autogroup_enabled = 0' >> /etc/sysctl.conf"
sudo /bin/su -c "echo 'vm.dirty_background_bytes = 67108864' >> /etc/sysctl.conf"
sudo /bin/su -c "echo 'vm.dirty_bytes = 536870912' >> /etc/sysctl.conf"
sudo /bin/su -c "echo 'vm.zone_reclaim_mode = 0' >> /etc/sysctl.conf"
#lxd
sudo /bin/su -c "echo 'fs.inotify.max_queued_events = 1048576' >> /etc/sysctl.conf"
sudo /bin/su -c "echo 'fs.inotify.max_user_instances = 1048576' >> /etc/sysctl.conf"
sudo /bin/su -c "echo 'fs.inotify.max_user_watches = 1048576' >> /etc/sysctl.conf"
sudo sysctl -p


Сохранить.

$ sudo sh tuning.sh

$ sudo lxd init
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]:
Name of the storage backend to use (btrfs, ceph, dir, lvm, zfs) [default=zfs]:
Create a new ZFS pool? (yes/no) [default=yes]:
Would you like to use an existing block device? (yes/no) [default=no]:
Size in GB of the new loop device (1GB minimum) [default=100GB]:
Would you like to connect to a MAAS server? (yes/no) [default=no]:
Would you like to create a new local network bridge? (yes/no) [default=yes]: no
Would you like to configure LXD to use an existing bridge or host interface? (yes/no) [default=no]: yes
Name of the existing bridge or host interface: br0
Would you like LXD to be available over the network? (yes/no) [default=no]:
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:


$ sudo reboot

Комментариев нет:

Отправить комментарий