Eureka Installation: NIS Server - calab-ntu/gpu-cluster GitHub Wiki

Installation: Master

  1. Reference

    1. https://blog.xuite.net/tolarku/blog/205091715-Unix+%E7%9A%84+NIS%2F+YP+Client+%E8%A8%AD%E5%AE%9A
    2. https://yungyuc.github.io/oldtech/debian/NISConf.html#id5
    3. https://docs.oracle.com/cd/E19683-01/816-7511/6mdgu0h22/index.html (recommended! If you encountered any troubles)
  2. Network setting

    1. check and record the name of network interface (eg. enp6s0)
      ip link
      
    2. modify configure file for network
      vi /etc/netplan/50-cloud-init.yaml
      
      Enter the following information
        network:
           ethernets:
              enp6s0: # <-- this is the name of network interface you just found
                      addresses: [192.168.0.149/24]
                      gateway4: 192.168.0.1
                      nameservers:
                         addresses: [140.112.254.4]
                      dhcp4: no
      
    3. apply the previous modification
      netplan apply
      
    4. check network and DNS
      ping www.google.com
      
  3. NIS master

    1. apt-get update

    2. apt-get install nis

    3. optional apt-get install yp-tools

    4. optional apt-get install nfs-kernel-server

    5. vi /etc/default/nis

      "NISSERVER=master"
      "SSERVER=master"
      "NISCLIENT=false"
      
    6. vi /etc/ypserv.securenets

      1. comment out this line at end:
        "0.0.0.0                0.0.0.0"
        
      2. append this line to the end.

        For security reason, this step is very important!

        "255.255.255.0   192.168.0.0"
        
    7. vi /var/yp/Makefile

      "MERGE_PASSWD=true"
      "MERGE_GROUP=true"
      
    8. modify the host file

      vi /etc/hosts 
      
    9. add users in sudo file

      vi /etc/sudoers
      
    10. give a new group name to NIS (eg. calab)

      vi /etc/group
      

      replace tumaz with new group name (eg. calab) "tumaz:x:1000: " --> "calab:x:1000: "

    11. service portmap restart

    12. service nis restart

    13. ypserv status

  4. trouble shooting

    1. check NIS domain name
      $ nisdomainname
      
    2. modify the NIS domain name
      vi /etc/defaultdomain
      
    3. apply the modifeid NIS domain name
      /usr/lib/yp/ypinit -m
      
      ps -e | grep rpcbind
      
      rpcinfo -p ypserver
      
      ps -e | grep yp
      
      rpcinfo gamer04
      

RAID1

  1. Reference

    1. https://askubuntu.com/questions/1066028/install-ubuntu-18-04-desktop-with-raid-1-and-lvm-on-machine-with-uefi-bios
    2. https://help.ubuntu.com/community/UEFI#Set_up_the_BIOS_in_EFI_or_Legacy_mode
    3. https://help.ubuntu.com/community/Installation/FromUSBStick#Boot_and_install
    4. https://askubuntu.com/questions/1128810/no-efi-system-partition-option-for-ubuntu-18-10
  2. OS ubuntu-18.04.3-live-server-amd64

  3. UEFI (important!!!!)

  4. enter the BIOS frequently hit Del during the boot process

  5. force BIOS to boot by UEFI instead of Legacy(default) Advanced-> CSM Configuration -> Boot option filter -> choose UEFI only

  6. make FAT32 filesystem for bootalbe USB (important!!!!)

    1. check the file system and the name of disk
      lsblk -f
      
    2. umount "ALL" partitions in USB
      umout /dev/sdb?
      
    3. make FAT32 filesystem for USB
      fdisk /dev/sdb
      
      choose n choose p hit Enter hit Enter hit Enter
  7. clone OS into bootable USB (only work with FAT32)

    dd if=ubuntu-18.04.3-live-server-amd64.iso of=/dev/sdb status=progress
    

    Assuming /dev/sdb is your USB device

  8. Install Ubuntu

    1. Choose manual partitioning select Manual

    2. Select available disks to format and mount 1.

      1. choose any one of SSDs, say disk1

      2. hit Add Partition

      3. Size: 20G

      4. Format: Leave unformatted

      5. hit create

        1. choose disk1
        2. hit Add Partition
        3. Size: leave blank
        4. Format: Leave unformatted
        5. hit create
      6. make and reserve a partition for mirrored EFI 1.

        1. choose another SSD, say disk2
        2. hit Add Partition
        3. Size: 512MB
        4. Format: Leave unformatted
        5. hit create
          1. choose disk2
          2. hit Add Partition
          3. Size: 20G
          4. Format: Leave unformatted
          5. hit create
          1. choose disk2
          2. hit Add Partition
          3. Size: leave blank
          4. Format: Leave unformatted
          5. hit create
    3. hit create software RAID (md)

    4. select a pair partitions as RAID 1

    5. repeat Step3-4

    6. hit md1 (new) (20G)

    7. select Format

    8. Format SWAP

    9. hit md1 (new) (211G)

    10. select Format

    11. Format ext4

    12. mount /

    13. hit Done

  9. checks

    1. Check which EFI partition has been mounted. Most likely /dev/sda1.
      mount | grep boot
      
    2. watch RAID status. Most likely it is synchronizing. please wait patiently for synchronizition.
      watch -n 0.5 cat /proc/mdstat
      
  10. Clone the existing EFI partition to the partition you just reserved for mirrored EFI

    dd if=/dev/sda1 of=/dev/sdb1 status=progress
    

    /dev/sda1: the existing EFI partition /dev/sdb1: mirrored EFI

  11. Insert the second boot partition into boot chain

    1. check the file name for the ubuntu boot entry. eg. \EFI\UBUNTU\SHIMX64.EFI
      efibootmgr -v
      
    2. insert the second boot pration(sdb) into boot chain
      efibootmgr -c -d /dev/sdb -p 1 -L "tumaz2" -l \EFI\UBUNTU\SHIMX64.EFI
      

      Assuming /dev/sdb is the partition to be mirrored EFI

  12. DONE!

    Now the system should boot even if either of the drives fail!

QUOTA

  1. installation

    sudo apt update
    sudo apt install quota
    
  2. report all user

    repquota -s /
    
  3. report specific user

    quota -vs [user name]
    
  4. set quota (unit: G, M, K)

    setquota -u [user name] 200M 220M 0 0 /
    
  5. set grace (unit: second)

    setquota -t 864000 864000 /
    
  6. Ref:

    1. https://www.digitalocean.com/community/tutorials/how-to-set-filesystem-quotas-on-ubuntu-18-04
    2. http://note.drx.tw/2008/03/quotagrace-time.html
    3. https://david50.pixnet.net/blog/post/45238215-%5B%E7%AD%86%E8%A8%98%5Dquota%E7%A3%81%E7%A2%9F%E9%85%8D%E9%A1%8D

Links