Dockerized (swarm) Plex, iSCSI config folder, and now with more stability
[EDIT] This was recovered due to a massive db crash and losing a couple of years worth of articles. Dates are mismatching. [EDIT]
Hey everyone.
So in this article i am writing the steps needed to connect an iscsi mount to your machine to use (in my case) as a Plex Media Server config mount.
The need for this arose after trying to run Plex in Docker Swarm and trying to mount the config folder in the NFS system i have setup and having it fail within seconds of starting up which led to locking the stack to one node and keeping the config mount on the local machine.
After some extensive testing, mounting the iscsi drive and using it rather than the local share allowed for Plex to be properly configured in the stack and not setting a constraint to one node.
At time of writing this was tested and confirmed with:
– iSCSI Target: Synology DS1819+ running DSM 7.2-64570 Update 1 with a 10g eth card
– iSCSI initiator: Ubuntu 20.04.6 LTS
– Plex Media Server Version 1.32.5.7349
– Docker Engine Version 24.0.6
iSCSI Target
For this section i will quickly walk you through (with screenshots) how to setup an iSCSI target on Synology. I wont go into to too much detail in this section since it is decently straight forward.
Start by opening the “SAN Manager” (icon showed below):
Click to enlarge
Once you click through you should see a similar window to this:
Click to enlarge
In this window you will click “iSCSI” on the left and then click “Add” which will bring you to this window:
Click to enlarge
Make sure you name it something that makes sense to you.
We won’t go into CHAP configuration for this write up. I will leave that for a future article.
Once you are happy with the Name click “Next” which will bring you to this window:
Click to enlarge
Since we do not have an existing LUN we will create a new one.
So click “Next” which will bring you to this window:
Click to enlarge
Again, give this a unique name.
For the purpose of our usage set it to a reasonable size that will house our Plex config folder (I used 500gb).
For “Space allocation” keep this option as “Thick provisioning”.
Click “Next” which will bring you to this window:
Click to enlarge
If you are satisfied with your options so far click “Done” and then click “Overview” which will ook similar to this:
Click to enlarge
As you can see in our example “Target-1” is showing as ready.
We can proceed on to the next section.
iSCSI Initiator
sudo apt install open-iscsi -y
sudo systemctl enable open-iscsi
sudo systemctl enable iscsid
Next sudo vi /etc/iscsi/iscsid.conf
uncomment “# node.startup = automatic”
comment “node.startup = manual”
————
next
sudo iscsiadm \ --mode discovery \ --type sendtargets \ --portal 192.168.100.71
192.168.100.70:3260,1 iqn.2000-01.com.synology:SYNO.Target-1.f9851ad3af9
192.168.100.71:3260,1 iqn.2000-01.com.synology:SYNO.Target-1.f9851ad3af9
[fd01:470:88f9:100::70]:3260,1 iqn.2000-01.com.synology:SYNO.Target-1.f9851ad3af9
[fd01:470:88f9:100::71]:3260,1 iqn.2000-01.com.synology:SYNO.Target-1.f9851ad3af9
sudo iscsiadm \
--mode node \
--target iqn.2000-01.com.synology:SYNO.Target-1.f9851ad3af9 \
--portal 192.168.100.70:3260 \
--login
sudo iscsiadm \
--mode node \
--target iqn.2000-01.com.synology:SYNO.Target-1.f9851ad3af9 \
--portal 192.168.100.71:3260 \
--name discovery.sendtargets.use_discoveryd \
--value Yes
sudo iscsiadm \
--mode node \
--target iqn.2000-01.com.synology:SYNO.Target-1.f9851ad3af9 \
--portal 192.168.100.71:3260 \
--name discovery.sendtargets.discoveryd_poll_inval \
--value 30
sudo blkid
/dev/md0p1: UUID="222ac411-912f-4d1d-8a82-6ef7d71240d9" TYPE="ext4" PARTUUID="15e9fbd6-f44c-457e-be96-07e7aa11f4ae"
/dev/md1p1: UUID="2cd56274-1e16-4af6-9bff-56ae27f52e13" TYPE="swap" PARTUUID="a9e40376-2cc6-4fc3-a961-d1d7397851fb"
/dev/md2p1: UUID="5d91475d-d5f8-4f66-8abd-2c5afb9b3fe9" TYPE="ext4" PARTUUID="715ee574-2fd7-4812-859f-6f1d2349899a"
/dev/sda: UUID="70d3e85d-2b41-434a-83cc-8d33a03ebe35" PARTUUID="94c73745-01"
/code>
now create filesystem on disk
use either fdisk or parted to create a partition on the new disk (/dev/sda)
once done then create a filesystem (for our example we are using ext4)
sudo mkfs.ext4 /dev/sda1
when this is complete lets add this disk to the fstab file so lets run blkid again to get the UUID :
/dev/md0p1: UUID="222ac411-912f-4d1d-8a82-6ef7d71240d9" TYPE="ext4" PARTUUID="15e9fbd6-f44c-457e-be96-07e7aa11f4ae"
/dev/md1p1: UUID="2cd56274-1e16-4af6-9bff-56ae27f52e13" TYPE="swap" PARTUUID="a9e40376-2cc6-4fc3-a961-d1d7397851fb"
/dev/md2p1: UUID="5d91475d-d5f8-4f66-8abd-2c5afb9b3fe9" TYPE="ext4" PARTUUID="715ee574-2fd7-4812-859f-6f1d2349899a"
/dev/sda1: UUID="70d3e85d-2b41-434a-83cc-8d33a03ebe35" TYPE="ext4" PARTUUID="94c73745-01"
create the mountpoint that you want to use (in our case its /pms)
sudo mkdir /pms
Now add the line below (with your matching info) to /etc/fstab :
/dev/disk/by-uuid/70d3e85d-2b41-434a-83cc-8d33a03ebe35 /pms ext4 _netdev 0 1
now lets mount it :
sudo mount -a
df -h
Filesystem Size Used Avail Use% Mounted on
udev 63G 0 63G 0% /dev
tmpfs 13G 2.3M 13G 1% /run
/dev/md2p1 441G 154G 265G 37% /
tmpfs 63G 0 63G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 63G 0 63G 0% /sys/fs/cgroup
/dev/md0p1 984M 210M 707M 23% /boot
/dev/nvme1n1p1 511M 6.1M 505M 2% /boot/efi
tmpfs 13G 0 13G 0% /run/user/1000
/dev/sda1 492G 128G 339G 28% /pms
Leave a Reply