Create a 128GB disk image for LXC storage:
sudo dd if=/dev/zero of=/data3/lxc/psap1alxc001.img bs=1G count=128
performs the following actions:
sudo
: Runs the command with superuser privileges.dd
: A low-level copying tool used for creating disk images.if=/dev/zero
: The input file (if
) is /dev/zero
, a special file that generates an endless stream of null bytes (0x00
). This ensures the created file is zero-filled.of=/data3/lxc/psap1alxc001.img
: The output file (of
) is a new disk image located at /data3/lxc/psap1alxc001.img
.bs=1G
: The block size (bs
) is set to 1GB, meaning data will be written in chunks of 1GB.count=128
: Specifies the number of blocks to be written. Since each block is 1GB, this results in a total file size of 128GB.This command creates a 128GB empty disk image, which is later used to create a ZFS storage pool for LXC containers.
Create a ZFS storage pool using the disk image:
sudo zpool create psap1alxc001 /data3/lxc/psap1alxc001.img
Check if the ZFS pool was created successfully:
sudo zpool status
Create an LXC storage pool using the ZFS pool:
lxc storage create psap1alxc001 zfs source=psap1alxc001
List available LXC storage pools:
lxc storage list
NAME | DRIVER | SOURCE | DESCRIPTION | USED BY | STATE |
---|---|---|---|---|---|
psap1alxc001 | zfs | psap1alxc001 | 2 | CREATED |
psap1alxc001
psap1alxc001
4
12 GiB
0
psap1alxc001
in the LXD UI.eth0:
hwaddr: 0a:01:e1:20:00:11
ip link set eth0 down
172.21.0.75
using the MAC address 0a:01:e1:20:00:11
.ip link set eth0 up
psap1alxc002
psap1alxc002
128 GiB
.4
12 GiB
0
psap1alxc002
in the LXD UI.eth0:
hwaddr: 0a:01:e1:30:00:12
172.21.0.76
using the MAC address 0a:01:e1:30:00:12
.ip link set eth0 down
ip link set eth0 up
Create a 128GB disk image for LXC storage:
sudo dd if=/dev/zero of=/data3/lxc/psap1alxc003.img bs=1G count=128
performs the following actions:
sudo
: Runs the command with superuser privileges.dd
: A low-level copying tool used for creating disk images.if=/dev/zero
: The input file (if
) is /dev/zero
, a special file that generates an endless stream of null bytes (0x00
). This ensures the created file is zero-filled.of=/data3/lxc/psap1alxc003.img
: The output file (of
) is a new disk image located at /data3/lxc/psap1alxc003.img
.bs=1G
: The block size (bs
) is set to 1GB, meaning data will be written in chunks of 1GB.count=128
: Specifies the number of blocks to be written. Since each block is 1GB, this results in a total file size of 128GB.Create a ZFS storage pool using the disk image:
sudo zpool create psap1alxc003 /data3/lxc/psap1alxc003.img
Check if the ZFS pool was created successfully:
sudo zpool status
Create an LXC storage pool using the ZFS pool:
lxc storage create psap1alxc003 zfs source=psap1alxc003
List available LXC storage pools:
lxc storage list
NAME | DRIVER | SOURCE | DESCRIPTION | USED BY | STATE |
---|---|---|---|---|---|
psap1alxc003 | zfs | psap1alxc003 | 2 | CREATED |
psap1alxc003
psap1alxc003
4
12 GiB
0
psap1alxc003
in the LXD UI.eth0:
hwaddr: 0a:01:e1:40:00:13
ip link set eth0 down
172.21.0.77
using the MAC address 0a:01:e1:40:00:11
.ip link set eth0 up
This document outlines the changes made to the Tomcat service on the LXC nodes (psap1alxc001
, psap1alxc002
, and psap1alxc003
). The service name and directory path were updated to reflect the new project structure.
Service Name Change:
tomcat-portereu.service
tomcat-psap.service
Tomcat Directory Path Update:
/opt/portereu/tomcat
/opt/ps/tomcat
sudo systemctl stop tomcat-portereu.service
sudo mv /etc/systemd/system/tomcat-portereu.service /etc/systemd/system/tomcat-psap.service
sudo sed -i 's|/opt/portereu/tomcat|/opt/ps/tomcat|g' /etc/systemd/system/tomcat-psap.service
sudo systemctl daemon-reload
sudo systemctl start tomcat-psap.service
sudo systemctl enable tomcat-psap.service
sudo systemctl status tomcat-psap.service