Skip to main content

Primary links

  • Home
  • AI
  • Kubernetes
  • Incus
  • Ansible
  • Terraform
  • OpenStack
  • Virtualization
  • Linux
  • SmartHome
  • HowTo

Misc

  • Linux
  • Hardware
  • Programming
  • Databases
  • Multimedia
  • Windows

Cloud

  • OpenStack
  • cloud-config
  • nextcloud

Virtualization

  • Virtualization
  • Incus
  • Docker
  • KVM
  • Kubernetes
  • LXC
  • LXD
  • QEMU
  • VMware
  • VirtualBox
  • multipass
  • podman
  • vagrant
  • XEN

Network

  • DNS
  • Firewall
  • Linux
  • OpenvSwitch
  • SSL
  • VLAN
  • VPN
  • iPXE
  • namespaces
  • nmcli
  • tcpdump

Storage

  • CEPH
  • DRBD
  • LVM
  • S3
  • ZFS
  • btrfs

Automation / CI/CD

  • Install
  • Ansible
  • GitLab
  • LLM
  • Preseed
  • Puppet
  • Terraform
  • Ubuntu autoinstall

Monitoring / Visualisation

  • Grafana
  • Icinga
  • Prometheus
  • Monitoring
  • ELK
  • mermaid

S3 storage under Linux / Ubuntu

CrossFTP
https://www.crossftp.com/download.htm

wget https://www.crossftp.com/crossftp_1.99.9.deb -qP /tmp/
sudo dpkg -i /tmp/crossftp_*.deb

DragonDisk (s3 GUI manager)
http://www.s3-client.com/

sudo add-apt-repository -y ppa:rock-core/qt4
sudo apt-get install -y libqt4-dbus libqt4-network libqt4-xml libqtcore4 libqtgui4

# installation
wget http://www.s3-client.com/download-amazon-s3-client/dragondisk_1.0.5-0ubuntu_amd64.deb -qO /tmp/dragondisk_1.0.5-0ubuntu_amd64.deb
sudo dpkg -i /tmp/dragondisk_1.0.5-0ubuntu_amd64.deb

Ansible s3 module
https://docs.ansible.com/ansible/latest/modules/aws_s3_module.html
https://linuxhint.com/installing_minio_ubuntu/

Retention
https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config
https://help.switch.ch/engines/documentation/s3-like-object-storage/s3-lifecycle/
https://jahed.dev/2018/05/20/enforcing-retention-policies-on-s3/

MC

wget https://dl.minio.io/client/mc/release/linux-amd64/mc

mc ls mycloud/images
mc mb mycloud/images/2020-02-06/
mc cp amphora-x64-haproxy.raw.bz2 mycloud/images/2020-02-06/

Get credentials for bucket

# ssh cephadm.dev.i.example.com
radosgw-admin bucket list | jq -r '.[]' | egrep -i image | while read bucket; do
    radosgw-admin metadata get "bucket:${bucket}" | jq -c '.data | (.owner, (.bucket | {name, tenant, bucket_id}))'
done

# ssh kolla.dev.i.example.com
openstack project show ${PROJECT_ID}
openstack credential list --type ec2 | grep ${PROJECT_ID}
openstack user show ${USER_ID}

awscli

php-fpm under Nginx

Install

sudo apt install -y php-fpm nginx #mariadb-server php-mysql php-gd php-curl

Configure php-fpm

# /etc/php/7.2/fpm/pool.d/www.conf

[www]
user = www-data
group = www-data
listen = /run/php/php7.2-fpm.sock
;listen = 127.0.0.1:9000
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

Configure Nginx

# /etc/nginx/sites-enabled/default

server {
...

# pass PHP scripts to FastCGI server

location ~ \.php$ {
include snippets/fastcgi-php.conf;

# use unix socket

fastcgi_pass unix:/run/php/php7.2-fpm.sock;

# use tcp socket

#fastcgi_pass 127.0.0.1:9000;
}
...
}

service nginx reload

Links
http://www.linux-magazin.de/magazine/listings/#2012-01&magento

Vault

Install

wget https://releases.hashicorp.com/vault/0.11.5/vault_0.11.5_linux_amd64.zip -P /tmp/
apt install -y unzip
unzip -d /usr/sbin /tmp/vault_0.11.5_linux_amd64.zip

vault -autocomplete-install

Linux
https://learn.hashicorp.com/vault/

Duplicity with S3

Install

sudo apt install -y duplicity python-boto

SSH

duplicity incr --log-file /tmp/duplicity.log /etc/  scp://foo@10.0.1.123//media/etc

S3

vi ~/.boto
[Credentials]
aws_access_key_id = KEY_ID
aws_secret_access_key = SECRET_ACCESS_KEY

# create backup to s3
duplicity full --log-file /tmp/duplicity.log /etc/ s3://s3.example.com/backup/host.examp.eocm/etc/

duplicity list-current-files s3+http://bucket/folder

WebDav

export FTP_PASSWORD="pass1234"
duplicity full \
  --log-file /var/log/duplicity.log /etc \
  webdavs://'user@example.com'@b24-foo.bitrix24.de/company/personal/user/1/disk/path/backup/

Links
http://duplicity.nongnu.org/duplicity.1.html
https://www.privacy-handbuch.de/handbuch_39e1.htm
https://www.digitalocean.com/community/tutorials/how-to-use-duplicity-with-gpg-to-back-up-data-to-digitalocean-spaces

GitLab registry with S3 storage

Configure CEPH

touch /tmp/placeholder
s3cmd mb s3://gitlab
s3cmd put /tmp/placeholder s3://gitlab
s3cmd ls s3://gitlab
s3cmd du s3://gitlab

Configure GitLab

# /etc/gitlab/gitlab.rb
...
registry_external_url 'https://registry.example.com'
registry_nginx['enable'] = true
registry_nginx['ssl_certificate'] = "/etc/gitlab/ssl/registry.example.com.crt"
registry_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/registry.example.com.key"
#registry['log_level'] = "debug"
#registry['storage_delete_enabled'] = true
...
registry['storage'] = {
  's3' => {
     'accesskey' => 'YOUR_ACCESS_KEY',
     'secretkey' => 'YOUR_SECRET_KEY',
     'bucket'    => 'gitlab',
     'region'    => 'us-west-1',
     'regionendpoint' => 'https://s3.example.com'
  },
  'redirect' => {
    'disable' => true
  }
}

cleanup registry (test):
sudo gitlab-ctl registry-garbage-collect

Links
https://gitlab.com/gitlab-org/gitlab-ce/issues/19356
https://docs.gitlab.com/ce/administration/container_registry.html
https://docs.docker.com/registry/configuration/#storage
https://icicimov.github.io/blog/server/GitLab-server-with-LDAP-and-S3-backend/

cloud-image-utils

sudo apt install -y qemu-kvm cloud-image-utils
wget https://cloud-images.ubuntu.com/releases/18.04/release/ubuntu-18.04-server-cloudimg-amd64.img

#cloud-config
password: ubuntu
chpasswd: { expire: False }
ssh_pwauth: True
ssh_import_id: ${USER}

cloud-localds seed.img seed
sudo kvm-spice -m 2048 -drive file=ubuntu-18.04-server-cloudimg-amd64.img,if=virtio,cache=writeback -cdrom seed.img -net nic,model=virtio -net user,hostfwd=tcp::222-:22
# -balloon virtio  

# login credentials:
user: ubuntu
pass: ubuntu

ssh ubuntu@localhost:2222

LXD: Create container with profile (connect to VLAN)

create profile

lxc profile copy default mgmt-dev
# lxc profile list
lxc profile device set mgmt-dev eth0 nictype macvlan
lxc profile device set mgmt-dev eth0 parent mgmt-dev-v4432
lxc profile show mgmt-dev

create container with profile

lxc launch ubuntu:18.04 bionic-mgmt-dev -p mgmt-dev
lxc ls

Enable container nesting

lxc config set bionic-mgmt-dev security.nesting true

Configure IP

cat < /var/lib/lxd/containers/bionic-mgmt-dev/rootfs/etc/netplan/50-cloud-init.yaml
network:
  version: 2
  ethernets:
    eth0:
      dhcp4: no
      addresses: [10.0.0.123/24]
      gateway4: 10.0.0.254
      nameservers:
        addresses: [10.0.0.253, 10.0.1.253]
        search: [lxd, dev]
EOF

Start container

lxc exec bionic-mgmt-dev bash

Ubuntu: Instlal lldpd (Link Layer Discovery Protocol)

sudo apt-add-repository universe
sudo apt install -y lldpd

# optional: enable Cisco CDP protocol
cat < /etc/default/lldpd 
DAEMON_ARGS="-c"
EOF
service lldpd restart

# get info
lldpctl

# get interface / switch / port
lldpctl | egrep "Interface|SysName|PortID"

lldpctl | egrep "Interface|SysName|PortID" | awk -F  ' *: *' '{print $2}' | awk -F  ',' '{print $1}' | paste - - - | \
  egrep "^e" | awk '{print "'"$NODE"'",$1,$2,$4}' | column -t | sort -u -k 1,2

CEPH

Releases
https://docs.ceph.com/docs/master/releases/

CLI

ceph -v
ceph -s
ceph df

ceph status
ceph health detail
ceph df detail
ceph osd lspools
ceph osd pool ls detail

# replication size / count
ceph osd pool set os-dev_glance min_size 1
ceph osd pool set os-dev_glance size 2
ceph osd pool get os-dev_glance size

# disable rebuild
ceph osd set noout 

# enable rebuild
ceph osd unset noout

#default 1 3 3
ceph tell 'osd.*' injectargs '--osd_max_backfills 1 --osd_recovery_max_active 1 --osd_recovery_op_priority 3'

# health
ceph health detail 
ceph --version
rados list-inconsistent-obj 6.115 --format=json-pretty
ceph pg repair 6.115
ceph -w

# erasure
ceph osd erasure-code-profile ls
ceph osd pool create   erasure 

ceph health

# watch
ceph -w

ceph osd unset norecover
ceph osd unset nobackfill
ceph osd unset noout
ceph health

# get cluster’s FSID/UUID
ceph fsid

# additional commands
ceph tell mon.\* injectargs '--osd_pool_default_size=2'
ceph config set mgr target_max_misplaced_ratio .01
ceph osd set-require-min-compat-client luminous

monitoring

ceph mgr module enable prometheus

balancer

ceph mgr module enable balancer
ceph balancer mode upmap
ceph balancer on

rados / pool

rados df

Monitoring
https://github.com/ceph/ceph-nagios-plugins/releases

# Build nagios-plugins-ceph
sudo apt-get install -y devscripts fakeroot build-essential dh-python
git clone https://github.com/ceph/ceph-nagios-plugins.git
cd ceph-nagios-plugins#
make deb
sudo dpkg -i nagios-plugins-ceph_*_all.deb

# create wrapper for kolla-ansible installation
cat < /usr/bin/ceph
#!/bin/bash
docker exec -it ceph_mon ceph $@
EOF
chmod +x /usr/bin/ceph

/usr/lib/nagios/plugins/check_ceph_health

Replace OSD

LLDP: Identify switch port to which the server is connected

Show LLDP neighbors

networkctl lldp

lldpctl
http://www.panticz.de/lldpd

for NIC in $(find /sys/class/net -type l -not -lname "*virtual*" -printf "%f\n" | sort); do
    echo "NIC: ${NIC}"
    echo "NIC MAC: $(ethtool -P ${NIC})"
    timeout 300 tcpdump -nn -v -i ${NIC} -s 1500 -c 1 "ether[20:2] == 0x2000"
done

Get host port, switch, switch port assignment

LLDP_JSON=$(lldpctl -f json)

NICS=$(echo ${LLDP_JSON} | jq -r '.lldp.interface[] | select(.[].port.id.type != "mac") | keys[]')
# echo ${NICS}

for NIC in ${NICS}; do
    # echo ${HOSTNAME}
    # echo ${NIC}

    SWITCH_NAME=$(echo ${LLDP_JSON} | jq -r ".lldp.interface[].${NIC} | select(.chassis != null) .chassis | keys[]")
    # echo ${SWITCH_NAME}

    SWITCH_PORT=$(echo ${LLDP_JSON} | jq -r ".lldp.interface[].${NIC} | select(.chassis != null) .port.id.value")
    # echo ${SWITCH_PORT}

    SWITCH_VLAN=$(echo ${LLDP_JSON} | jq -r ".lldp.interface[].${NIC} | select(.chassis != null) .vlan.\"vlan-id\"")
    # echo ${SWITCH_VLAN}

    echo "${HOSTNAME},${NIC},${SWITCH_NAME},${SWITCH_PORT},${SWITCH_VLAN}"
done

Pagination

  • First page
  • Previous page
  • …
  • Page 17
  • Page 18
  • Page 19
  • Page 20
  • Page 21
  • Page 22
  • Page 23
  • Page 24
  • Page 25
  • …
  • Next page
  • Last page
Profiles GitHub StackOverflow LinkedIn Xing
Contact Imprint
© panticz 2026

Cookie-Einstellungen

Diese Website nutzt eingebettete Inhalte von Drittanbietern (z.B. YouTube, SoundCloud). Beim Laden dieser Inhalte werden Daten an die jeweiligen Anbieter übermittelt. Datenverarbeitungserklärung