This is an old revision of the document!
Beispiel vom Lab mit ein paar 3D-Drucker Komponenten tragbar gemacht…
Es sind 4 NUCs, kombiniert mit einem 10 Port Switch. Wer viel Geld übrig hat, nimmt einen 10GB Switch. Bei mir hat es nur für 1GB gereicht…
Um in der gesamten Infrastruktur DNS, DHCP u.s.w. zu haben, wird ein RaspberryPi eingesetzt. Der ist gleichzeitig WLAN Accesspoint, damit man einfach auf die Hosts etc. kommt. Gleichzeitig ist der RasPi auch WLAN Client, damit man einfach Pakete aus dem Internet laden kann.
Der RasPi dient gleichzeitig als PowerShell/PowerCLI Host. Damit erreiche ich auch, dass vCenter und andere Appliances automatisch durch den RasPi gestartet werden. PowerShell ist mir sympatischer als Perl
Folgende HW habe ich genutzt:
Anz | Bezeichnung | Bemerkung |
---|---|---|
4 | Intel NUC8i7HNK | |
2 | Samsung 32 GB 260 pin DDR4-2666, SO-DIMM 4er Pack | Bzw. 8 Einzelmodule |
4 | Samsung SSD 970 EVO Plus Series NVMe 1 TB V-NAND MLC - M.2 2280 | |
4 | Samsung SSD 970 EVO Plus Series NVMe 1 TB M.2 | kleinere reicht auch. z.B. Gigabyte NVMe SSD 128 GB NVMe 1.3 M.2 2280 für 30€ |
8 | SanDisk 32GB Ulta Fit USB 3.1 schwarz | 4 für ESXi Boot, 4 für lokal VMFS (Log Store….) |
1 | 0,5m CAT.7 Gigabit Patchkabel | 10er Pack |
1 | Cisco SG350-10 10-Port Gigabit Managed Switch | |
1 | RaspberryPi | |
1 | EDIMAX EW-7811UN Wireless USB Adapter, 150 Mbit/s, IEEE802.11b/g/n | Wenn RasPi WLAN Access und Client in einem sein soll |
1 | Raspi Netzteil | |
1 | RPI DS1307 RTC | z.B. AMAZON “MakerHawk RPI DS1307 RTC Modul Himbeer pi Echtzeituhrmodul mit Münzbatterie” |
Für einen “Spiel Cluster” wird ein DNS/DHCP Server gebraucht. Dieser sollte neben Ethernet auch gleichzeitig ein WLAN Access Point und ein WLAN Client sein. Hier eine Config von mir. eth0 und wlan0 sind die DNS/DHCP Netze. wlan0 ist Accesspoint. wlan1 (Edimax mini) ist WLAN Client.
Wir brauchen einige Pakete….
apt-get update apt-get upgrade apt-get install hostapd apt-get install dnsmasq apt-get install bridge-utils apt-get install iptables-persistent
DNS in der /etc/hosts klar machen…
127.0.0.1 localhost 192.168.10.1 rasp-dns.schubi.local rasp-dns 192.168.10.10 vcsa.schubi.local vcsa 192.168.10.11 esx-1.schubi.local esx-1 192.168.10.12 esx-2.schubi.local esx-2 192.168.10.13 esx-3.schubi.local esx-3 192.168.10.14 esx-4.schubi.local esx-4
In der /etc/dhcpcd.conf den DHCP Server konfigurieren. Domain Server ist der Raspi selber, alles andere regelt Google…
static routers=192.168.10.1 static domain_name_servers=192.168.10.1 8.8.8.8
In der /etc/resolvconf.conf den DNSMasq DNS Server konfigurieren.
name-servers="127.0.0.1"
In der /var/run/dnsmasq/resolv.conf den DNSMasq DNS Server konfigurieren.
nameserver 192.168.10.1
In der /etc/dnsmasq.conf wird die Domain festgelegt. Zwischen wlan0 und eth0 wird eine Bridge gebaut. Die Bridge ist das Device für DHCP. Damit bekommt man eine DHCP Adresse, egal ob über WLAN Accesspoint oder Ethernet…
expand-hosts domain=schubi.local interface=br0 listen-address=127.0.0.1 listen-address=192.168.10.1 bind-interfaces server=192.168.10.1 dhcp-range=192.168.10.50,192.168.10.128,255.255.255.0,24h
In der /etc/hostapd/hostapd.conf wird wlan0 als Accesspoint konfiguriert
interface=wlan0 bridge=br0 hw_mode=g channel=7 wmm_enabled=1 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP ssid=vSAN_Schubi wpa_passphrase=VMware1!
In der bash Shell wird die Bridge gebaut
brctl addbr br0 brctl addif br0 eth0 brctl show
In der /etc/network/interfaces konfigurieren wir eth0 und br0 und definieren dauerhaft die Bridge Ports. wlan1 wird WLan Client (in meinem Fall tether ich über das Telefon)
source-directory /etc/network/interfaces.d auto eth0 allow-hotplug eth0 iface eth0 inet dhcp auto br0 iface br0 inet static address 192.168.10.1 netmask 255.255.255.0 network 192.168.10.0 dns-nameserver 192.168.10.1 dns-search schubi.local bridge_ports eth0 wlan0 auto wlan1 allow-hotplug wlan1 iface wlan1 inet dhcp wpa-ssid "iPhone von Schubi" wpa-psk "XXXXXXX"
In der Bash wird nun noch das IP Masquerading auf wlan1 konfiguriert. Durch das iptables-persistent Paket wird dies sofort persistent.
iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE iptables -t nat -L
Zeit für einen Reboot…
hilfreiche Links:
apt-get install libunwind8 wget https://github.com/PowerShell/PowerShell/releases/download/v6.2.3/powershell-6.2.3-linux-arm32.tar.gz mkdir ~/powershell tar -xvf ./powershell-6.2.3-linux-arm32.tar.gz -C ~/powershell #Start der Shell mit ~/powershell/pwsh #...oder Alias alias powershell='~/powershell/pwsh'
$PSVersionTable Install-Module -Name VMware.PowerCLI -Scope CurrentUser Set-PowerCLIConfiguration -InvalidCertificateAction:Ignore Get-PowerCLIVersion Get-PowerCLIConfiguration
Die Powershell loggt wie Blöde in /var/log/messages. Dazu gibt es zwei Workarounds. Dokumentiert unter
https://github.com/PowerShell/PowerShell/issues/6324
Added a cron job to find/delete those files and added the following file (/etc/rsyslog.d/40-powershell.conf) to stop logging which seems to work okay.
:syslogtag, contains, “powershell[” stop
bzw.
Lowering the log level from Powershell by doing the following fixes the verbose logging:
Find out where $PSHOME is. My $PSHOME pointed to /opt/microsoft/powershell/6/. Take note that $PSHOME is a variable in PWSH, not in any other shell.
Create a file in $PSHOME named powershell.config.json.
Add the following JSON to the file:
{ “LogLevel”: “error” }
Other log levels are found here: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_logging_non-windows?view=powershell-6#configuring-logging-on-non-windows-system
apt-get install vlan
In der /etc/modules
8021q
In der /etc/network/interfaces die virtuellen VLAN Nics configurieren
#Vlan3 vMotion auto eth0.3 iface eth0.3 inet static address 192.168.3.1 netmask 255.255.255.0 network 192.168.3.0 vlan_raw_device eth0 dns-nameserver 192.168.10.1 dns-search schubi.local #Vlan10 CLASS B auto eth0.10 iface eth0.10 inet static address 172.16.0.1 netmask 255.255.0.0 network 172.16.0.0 vlan_raw_device eth0 dns-nameserver 192.168.10.1 dns-search schubi.local #Vlan100 CLASS A auto eth0.100 iface eth0.100 inet static address 10.0.0.1 netmask 255.0.0.0 network 10.0.0.0 vlan_raw_device eth0 dns-nameserver 192.168.10.1 dns-search schubi.local
In der /etc/dnsmasq.conf
interface=eth0.3 listen-address=127.0.0.1 listen-address=192.168.3.1 bind-interfaces server=192.168.10.1 dhcp-range=192.168.3.10,192.168.3.250,24h interface=eth0.10 listen-address=127.0.0.1 listen-address=172.16.0.1 bind-interfaces server=192.168.10.1 dhcp-range=172.16.0.10,172.16.255.250,24h interface=eth0.100 listen-address=127.0.0.1 listen-address=10.0.0.1 bind-interfaces server=192.168.10.1 dhcp-range=10.0.0.10,10.255.0.250,24h
apt-get install libcairo2-dev apt-get install libjpeg62-turbo-dev apt-get install libpng12-dev apt-get install libossp-uuid-dev #optional apt-get install libavcodec-dev apt-get install libavutil-dev apt-get install libswscale-dev apt-get install libpango1.0-dev apt-get install libssh2-1-dev apt-get install libtelnet-dev apt-get install libvncserver-dev apt-get install libpulse-dev apt-get install libssl-dev apt-get install libvorbis-dev apt-get install libwebp-dev apt-get install libfreerdp2-2 # wget http://sourceforge.net/projects/guacamole/files/current/source/guacamole-server-0.9.14.tar.gz wget http://sourceforge.net/projects/guacamole/files/current/source/guacamole-client-0.9.14.tar.gz # tar xzf guacamole-server-0.9.14.tar.gz cd guacamole-server-0.9.14 ./configure --with-init-dir=/etc/init.d make
TBD…
https://wiki.52pi.com/index.php/DS1307_RTC_Module_with_BAT_for_Raspberry_Pi_SKU%3A_EP-0059
https://www.amazon.de/gp/product/B071HYN28Z/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1
raspi-config # in den "Interfacing Options" "P5 I2C" wählen und im folgenden Auswahlmenü # die Frage "Would you like the ARM I2C interface to be enabled?" mit "Yes" beantworten apt-get install ntpdate crontab -e # @reboot ntpdate -s 0.de.pool.ntp.org # 0 */6 * * * ntpdate -s 0.de.pool.ntp.org apt-get -y remove fake-hwclock update-rc.d -f fake-hwclock remove
Im File /lib/udev/hwclock-set die Zeilen kommentieren, um hw-clock system zu starten.
#if [ -e /run/systemd/system ] ; then # exit 0 #fi
In /boot/config.txt folgende Zeilen einfügen
dtparam=i2c_arm=on device_tree=bcm2710-rpi-3-b.dtb dtoverlay=i2c-rtc,ds1307
check mit
shutdown -r now root@rasp-dns:~# dmesg | grep rtc [ 6.044146] rtc-ds1307 1-0068: registered as rtc0 hwclock -w