Cours:ServeurDell : Différence entre versions
(→administration) |
(→raspberry pi) |
||
Ligne 142 : | Ligne 142 : | ||
**mount /dev/loop0p2 root/ | **mount /dev/loop0p2 root/ | ||
**https://github.com/raspberrypi/piserver/issues/55 | **https://github.com/raspberrypi/piserver/issues/55 | ||
+ | <source lang=bash> | ||
+ | But for educational purposes, here are the instructions for creating a custom piserver image: | ||
+ | |||
+ | the locations of the boot and root.tar files? | ||
+ | |||
+ | .tar.xz files are archives, a bit similar to .zip files. | ||
+ | You need to make those yourself first from the contents of your SD card. | ||
+ | |||
+ | A standard Raspbian SD card has two partitions. A FAT partition with the boot files. The contents of that should end up in boot.tar.xz | ||
+ | And an ext4 partition with the operating system itself. The contents of that should end up in root.tar.xz | ||
+ | |||
+ | Attach a SD card reader to the pc running piserver, and put the SD card you want to convert into it. | ||
+ | Open a terminal window. | ||
+ | Figure out the device name of the SD card is (e.g. sda). If you inserted (hotplugged) the SD card after the computer was already running, the easiest way is to enter "dmesg" and look at the last lines in the output. | ||
+ | run the following commands replacing sdX with the actual name of the device. | ||
+ | sudo bash | ||
+ | mkdir /tmp/mnt_boot /tmp/mnt_root | ||
+ | mount -o ro /dev/sdX1 /tmp/mnt_boot | ||
+ | mount -o ro /dev/sdX2 /tmp/mnt_root | ||
+ | cd /tmp/mnt_boot | ||
+ | bsdtar --numeric-owner --format gnutar --one-file-system -cpf ../boot.tar . | ||
+ | cd /tmp/mnt_root | ||
+ | bsdtar --numeric-owner --format gnutar --one-file-system -cpf ../root.tar . | ||
+ | cd /tmp | ||
+ | umount /tmp_mnt_boot | ||
+ | umount /tmp_mnt_root | ||
+ | xz boot.tar | ||
+ | xz root.tar | ||
+ | /var/lib/piserver/scripts/convert.sh boot.tar.xz root.tar.xz Your_custom_OS.tar.xz | ||
+ | rm boot.tar.xz root.tar.xz | ||
+ | The image you can import into piserver is now at /tmp/Your_custom_OS.tar.xz | ||
+ | </source> | ||
=partition /localHome= | =partition /localHome= |
Version du 11 mai 2021 à 09:37
Sommaire
administration
Commencé
Cluster Proxmox :
https://wiki.virtit.fr/doku.php/kb:linux:proxmox:cluster_deux_n%C5%93uds_proxmox
Gestion des quotas
Partition home, gestion sur serveur nfs 10.98.9.247
- https://doc.ubuntu-fr.org/quota
- http://aaronsplace.co.uk/blog/2019-02-12-zfsonline-nfs-quota.html
- https://docs.oracle.com/cd/E19253-01/820-2315/gazvb/index.html
sur le serveur nfs : 10.98.9.247
- quota zfs par utilisateur
- script dans /usr/local/iut/...
- ajouter des envois de mail dans le script
- service systemd => checkQuota.timer
Partition /localHome sur nomachine node
- quota ext4
- service systemd => checkQuota.timer dans /etc/systemd/system, qui utilise /usr/local/iut/admin/localHomeQuota
Supervision
- ansible
- rundeck
Session utilisateur
- scripts server.cfg (utilisateur nx)
- puis
- scripts node.cfg (utilisateur loginUrca)
Sur les nodes
modifier le fichier /usr/local/iut/nomachineScripts/nxScript
modifier le fichier /usr/local/iut/nomachineScripts/userScript
A la connexion
- sur terminal server
- /usr/local/iut/nomachineScripts/nxBLin
- /usr/local/iut/nomachineScripts/nxALin
- sur node
- /usr/local/iut/nomachineScripts/nxBSS
- /usr/local/iut/nomachineScripts/userBSS
- /usr/local/iut/nomachineScripts/userASS
- /usr/local/iut/nomachineScripts/nxASS
A la déconnexion
- sur terminal server
- rien !
- sur node
- /usr/local/iut/nomachineScripts/userBSC
- /usr/local/iut/nomachineScripts/nxBSC
- /usr/local/iut/nomachineScripts/userASC
- /usr/local/iut/nomachineScripts/nxASC
Quitter le player sans fermer la session
- /usr/local/iut/nomachineScripts/userBSD
- /usr/local/iut/nomachineScripts/userASD
Reconnection : sur le terminal server uniquement :
- /usr/local/iut/nomachineScripts/nxBLin
- /usr/local/iut/nomachineScripts/nxALin
A faire
Réseau
- acheter un switch 10G, ex :
- configurer "bonding" (redondance)
- per user ip
Divers
- onduleur
- etcd
administration
- centraliser journaux systemd
- Comment synchroniser les 2 nodes ???
- différences de config :
- nom de machine : hostname
- reseau iut : .248 ou .249
- reseau local : 192.168.x.x
- montage réseau local 192.168.x.x
- changer /usr/NX/etc/uuid
- outil pour trouver la différence entre les nodes (rsync) puis faire les modifs nécessaires
- pas forcément d'intérêt à ansible avec juste 2 nodes
- cloner les paquets installés :
- apt-clone clone nodeNomachine --with-dpkg-repack
- apt-clone restore /home/nodeNomachine.apt-clone.tar.gz
- différences de config :
- Comment sauvegarder un node
- depot paquets sur le nas : metapaquet ...
- replication ldap
- sauvegarde /home sur nas
- mise à jour config nomachein : /usr/NX/scripts/setup/nxserver --update
- sessions /usr/NX/scripts/setup/nxnode --availablesessionsetup
network
- change mtu on serveurs
raspberry pi
- piserver
- principe :
- boot par tftp
- montage nfs pour / et /home
- problèmes :
- dhcpcd ajoute une ip link-local : désactiver ipv4ll dans dhcpcd
- modifier dhcpcd.service:
[Unit] Description=dhcpcd on all interfaces Wants=network.target Before=network.target [Service] Type=forking PIDFile=/run/dhcpcd.pid ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -b -L ExecStop=/sbin/dhcpcd -x [Install] WantedBy=multi-user.target Alias=dhcpcd5.service
- config netboot : https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md
- BOOT_ORDER=0x2
- TFTP_IP=10.98.9.247
- principe :
- create custom os
- losetup -Pf 2020-08-20-raspios-buster-arm64.img
- losetup -l
- mount /dev/loop0p1 boot/
- mount /dev/loop0p2 root/
- https://github.com/raspberrypi/piserver/issues/55
But for educational purposes, here are the instructions for creating a custom piserver image:
the locations of the boot and root.tar files?
.tar.xz files are archives, a bit similar to .zip files.
You need to make those yourself first from the contents of your SD card.
A standard Raspbian SD card has two partitions. A FAT partition with the boot files. The contents of that should end up in boot.tar.xz
And an ext4 partition with the operating system itself. The contents of that should end up in root.tar.xz
Attach a SD card reader to the pc running piserver, and put the SD card you want to convert into it.
Open a terminal window.
Figure out the device name of the SD card is (e.g. sda). If you inserted (hotplugged) the SD card after the computer was already running, the easiest way is to enter "dmesg" and look at the last lines in the output.
run the following commands replacing sdX with the actual name of the device.
sudo bash
mkdir /tmp/mnt_boot /tmp/mnt_root
mount -o ro /dev/sdX1 /tmp/mnt_boot
mount -o ro /dev/sdX2 /tmp/mnt_root
cd /tmp/mnt_boot
bsdtar --numeric-owner --format gnutar --one-file-system -cpf ../boot.tar .
cd /tmp/mnt_root
bsdtar --numeric-owner --format gnutar --one-file-system -cpf ../root.tar .
cd /tmp
umount /tmp_mnt_boot
umount /tmp_mnt_root
xz boot.tar
xz root.tar
/var/lib/piserver/scripts/convert.sh boot.tar.xz root.tar.xz Your_custom_OS.tar.xz
rm boot.tar.xz root.tar.xz
The image you can import into piserver is now at /tmp/Your_custom_OS.tar.xz
partition /localHome
Déplacer certains fichiers de config dans ce répertoire !!
- fichiers utilisateurs google-chrome
- déplacer .local/share/baloo
- déplacer .config/pulse
- Quartier
- Téléchargements : effacer a chaque demarrage
déport usb
- désactiver secureboot si le module ne se charge pas
- pour recompiler le module usb
- /usr/local/iut/nomachineScripts/mkNxUsb
- cd /usr/NX/share/src/nxusb && make -f Makefile
- cp -arp /usr/NX/share/src/nxusb/nxusb.ko /usr/NX/bin/drivers/
- /usr/local/iut/nomachineScripts/mkNxUsb
Mesure de consommation
- serveur ftp sur 10.98.9.250
- identifiants cf document teams
- augmenter le nombre de connexions simultanées sur le serveur ftp !
Applis installées
- arduino => lanceur à faire
- quartus 18.1 => lanceur à faire
- Freecad
- openscad
- crossover => pour tests
- wine
Customiser xfce4 session
- script login et logout :
- ajouter un fichier executable
- /usr/local/bin/xfce4-session
- modifier les fichiers /etc/xdg/xfce4/*
- se servir de /etc/xdg/xdg-xubuntu/*
- dpkg-divert --add --local --divert /etc/xdg/xfce4/panel/default.xml.save /etc/xdg/xfce4/panel/default.xml
- nb workspace file:///home/jacquo03/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
- dpkg-divert --add --local --divert /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml.save /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml
nomachine Terminal Server
- désactiver des types de session
- A faire sur les nodes !!!
- https://www.nomachine.com/AR07P00989
- dans le fichier /usr/NX/etc/server.cfg
- modifier la clé AvailableSessionTypes
- /etc/NX/nxserver --restart
Nomachine node
- au besoin réactiver dans le bios "Embedded Video Controller"
- xubuntu 20.04
- mettre mot de passe root
- ssh
- apt install openssh-server
- autoriser root login
- systemctl restart sshd
- ldap
- lien dnUrca
- https://help.ubuntu.com/community/LDAPClientAuthentication#Assign_local_groups_to_users
- echo "map passwd loginShell \"/bin/bash\"" >> /etc/nslcd.conf
- create home dir :
- pam-auth-update
- /etc/init.d/nscd restart
- ajouter au fichier /etc/security/group.conf
- *;*;*;Al0000-2400;audio,cdrom,dialout,plugdev,video,dip
- ppa
- add-apt-repository ppa:kubuntu-ppa/backports
- add-apt-repository ppa:kubuntu-ppa/ppa
- Network
- apt install ethtool
- desinstaller network-manager
- systemd-networkd
- /etc/systemd/network/20-wired.network
[Match] Name=eno1 [Network] DHCP=yes
- systemd-resolved
- /etc/systemd/resolved.conf.d/dns_servers.conf
[Resolve] DNS=10.57.8.88 10.5.12.204 10.5.13.204 Domains=local.iut-troyes.univ-reims.fr iut-troyes.univ-reims.fr univ-reims.fr
- mise à jour
- apt-get install --install-recommends linux-generic-hwe-20.04
- apt install build-essential
- nvidia
- apt install linux-modules-nvidia-450-generic-hwe-20.04 nvidia-driver-450
- blacklist carte graphique intégrée + la désactiver dans le bios
- echo "blacklist mgag200" > /etc/modprobe.d/blacklist-video.conf
- update-initramfs -u
- nvidia-xconfig -enable-all-gpus -cool-bits=28 --allow-empty-initial-configuration
- Pb de ralentissement après un certain temps, mise en veille ?
- solution xorg.conf Option "HardDPMS" "false"
- https://virtualgl.org/Documentation/HeadlessNV
- nomachine
- telecharger nomachine-terminal-server-node_6.12.3_7_amd64.deb
- apt install /root/nomachine-terminal-server-node_6.12.3_7_amd64.deb
- virtualgl :
systemctl stop lightdm
rmmod nvidia_uvm
rmmod nvidia_drm
rmmod nvidia_modeset
rmmod nvidia
/etc/NX/nxserver --virtualgl-install
/etc/NX/nxserver --virtualgl yes
systemctl start lightdm
- logiciels
- cura
- openscad
- quartus
- eclipse + avr plugin
- ltspice
- charlyrobot
- eagle
- Todo
- utilisation usb
- arduino
- programmateur avr
- carte fpga
- programmateur fpga
- utilisation usb
montage nfs /home
- https://blog.frehi.be/2019/01/03/fs-cache-for-nfs-clients/ => abandonné
- https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/storage_administration_guide/fscachenfs
- https://zoomadmin.com/HowToInstall/UbuntuPackage/cachefilesd
- https://www.admin-magazine.com/HPC/Articles/Useful-NFS-Options-for-Tuning-and-Management
- https://doc.ubuntu-fr.org/nfs
- https://help.ubuntu.com/community/SettingUpNFSHowTo
- export sur le serveur
- modifier le nombre de process : /etc/default/nfs-kernel-qqch
- montage sur les clients
- attention aux options de montage et fonctionnement de chrome
- option de montage : defaults,noatime,intr,proto=udp,nolock
- utilisation de la connexion point à point 10G
- https://doc.ubuntu-fr.org/nfs
A remplacer par nfs directement par zfs ???
Logiciels
Wine
- Installer le logiciel :
- on installe chaque logiciel dans un "WINEPREFIX"
- utiliser l'application wineInstall pour faire le gros du boulot
- wineInstall fichierInstallation nomApplication
Processing
- installé dans /opt
Eagle
- installé dans /opt
Arduino
- utiliser avrdude local:
- supprimer /opt/arduino-1.8.13/hardware/tools/avr/bin/avrdude
- faire un lien vers l'executable
Eclipse
- download eclipse installer
- install as root
- /opt/eclipse/p2
- /opt/eclipse/cpp-xx-xx
- installer plugin avr comme root
- https://github.com/mnlipp/avr-eclipse-fork
Create a file named default.ini, or some other name, containing the following line: org.eclipse.ui.ide/SAVE_ALL_BEFORE_BUILD=true In your eclipse.ini file which already exists, add the following lines somewhere before the -vmargs line: -pluginCustomization /path/to/default.ini Where /path/to/default.ini is the full path to the default.ini file you created in the first step. If Eclipse will be used by multiple users on this machine, default.ini should be accessible by all of them.
- lancer après modifications : /usr/local/iut/update/majEclipse
#!/bin/bash cd /home ListeRep="$(find * -type d -prune)" for Rep in ${ListeRep}; do if [ $Rep == "skel" ] then user="root" else user=$Rep fi mkdir -p /home/$Rep/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/ cp /root/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/de.innot.avreclipse.core.prefs /home/$Rep/eclipse-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/ chown -R $user /home/$Rep/eclipse-workspace done
Quartus
cd /opt/intelFPGA/18.1/quartus/linux64/
mv libstdc++.so.6 libstdc++.so.6.quartus_distrib
ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6
mv liblzma.so.5 liblzma.so.5.quartus
ln -s /usr/lib/x86_64-linux-gnu/liblzma.so.5 liblzma.so.5
- Vitesse de compilation :
- fichier /opt/intelFPGA/default/quartus/linux64/assignment_defaults.qdf
- set_global_assignment -name SMART_RECOMPILE ON
- set_global_assignment -name NUM_PARALLEL_PROCESSORS ALL
- tweak pour contourner /home en nfs :
- HOME=/localHome/$USER /opt/intelFPGA/default/quartus/bin/quartus
- flexlm
cat /etc/systemd/system/flexlmAltera.service
[Unit]
Description=Licence manger for Altera
After=network.target
[Service]
Type=simple
User=root
#WorkingDirectory=/opt/flexlm/VENDOR
ExecStart=/usr/local/quartus/altera/lmgrd -z -c /usr/local/flexlm/licenses/license.dat
SuccessExitStatus=15
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target
- Programmation :
- utiliser openocd
- openocd -s share/openocd/scripts -f interface/altera-usb-blaster.cfg -c init -c "svf test.svf" -c shutdown
- quartus config :
- fichier /opt/intelFPGA/default/quartus/linux64/assignment_defaults.qdf
- set_global_assignment -name GENERATE_SVF_FILE On
- ou essayer de faire un chroot x86/amd64 puis jtag over ip
- utiliser openocd
iDrac
- accès à distance :
- vpn
- virtual console ne fonctionne pas avec chrome ?!
- tunnel ssh des ports 5900 et 443
- ssh -L 8000:10.98.1.250:443 10.98.x.x
- ssh -L 5900:10.98.1.250:5900 10.98.x.x
- installer os :
- media virtuel
- demarrer sur CD/DVD/ISO virtuel
- redémarrer le serveur
- récupérer idrac avec ipmitool
- ipmitool lan set 1 ipaddr 10.98.1.250
- ipmitool lan set 1 defgw ipaddr 10.98.1.254
- ipmitool lan set 1 access on
- https://www.thomas-krenn.com/en/wiki/Configuring_IPMI_under_Linux_using_ipmitool#LAN_Configuration