0
Completed

UMC memory expansion for database file

Alessandro Munari 6 years ago in Ideas updated by Vladimir Ovchinnikov (expert) 5 years ago 10

Hi, I noticed that the UMC server has a USB port. Is there any possibily to use this port to store the Server database ?

Maybe it requires some changes on server to select in wich path to store the database file.

If I use a 30Gb USB memory drive, I can store very large ammount of data into the UMC server.

Is there any possibilities ?

Hello.

You can connect to UMC USB-flash. However, the storage path for the iRidium server system database is reserved. We do not recommend changing it.

You can create a non-removable user base. Then move the database to another media and create a link to the new location in the Database directory.

any idea on how to do this ?

Completed

mybase.Open('MyBase.db', true);

Here the true parameter is undeleted folder. Documentation here.

After creating the user base:

1) To stop the iRidium server.

2) Directory /mnt/mmcblk0p1/iRidium Server/DataBase/UserDB/ move to USB-flash.

3) Create a link in /mnt/mmcblk0p1/iRidium Server/DataBase/ to the moved directory.

Same method can be applied also if I have a network path. for example a shared folder on a server or NAS ?

or it is just working internally in UMC server ?

Do I need to mount the shared folder path ?

thanks

If you have a NAS, you need to mount your network directory to the local file system. We did not check whether it would be possible to mount on CIFS or NFS, as UMC was not planned for such tasks. However, you can try.

Hi i try a Little bit, but i'm not so good in Linux. When you have time could you please send me step by step instruction both for, usb- flash and network folder ?

i think It could be usefull also for other users.

many thanks

+1

I know that when I select from the studio which variable to store it goes directly in the Iridium database. How can I choose in wich database to store the variable ?

I need to create script for that ? 

I think it will be good to add the popssibility to choose in wich directory to store the db file, and also allow, from the web server interface to select an USB or NETWORK path ... 

Don't you think is a good idea. The memory of UMC is very limited, but it can be expanded with USB drive or NETwork path (FTP, i.e) ...

Hello.

1) Install, configure and start NFS server on another host.

2) Create or select a directory on the UMC to mount the directory using the NFS Protocol.

3) At the UMC, run the command:

mount -o port=2049,nolock,proto=tcp 192.168.0.121:/share /export


Instead of "192.168.0.121", specify the address of your NFS server. Instead of "share", enter the name of the directory on your NFS server. Instead of "export", specify the directory name on your UMC. After the command at the mount point "export"will be a remote directory"share".


Attention! UMC was not designed for such work and was not tested. Use at your own risk.

+1

Hi,

I agree that that would be nice if it can choose where db file should be save 

BTW, I would like to share my method by using symbolic link from /var/lib/iRidium Server/DataBase to remote folder

(in my case SD card in UMC C3) (C2 also has SD card for database but i didn't test it yet)

PLEASE NOTE: put your own SD card in UMC C3 might void warranty since it need to make a hole in C3 Case in order

to put sd card in

1. plugin your SD card or USB

2. SSH to UMC

3. check your device path

fdisk -l

  and you should see something like this

Device       Boot StartCHS    EndCHS        StartLBA     EndLBA    Sectors  Size Id Type
/dev/mmcblk0p1    0,1,1       1023,3,16           16  124735487  124735472 59.4G 83 Linux
Disk /dev/mmcblk2: 3728 MB, 3909091328 bytes, 7634944 sectors
119296 cylinders, 4 heads, 16 sectors/track
Units: cylinders of 64 * 512 = 32768 bytes

Device       Boot StartCHS    EndCHS        StartLBA     EndLBA    Sectors  Size Id Type
/dev/mmcblk2p1    160,0,1     1023,3,16        10240     534591     524352  256M 83 Linux
/dev/mmcblk2p2    1023,3,16   1023,3,16       534592    1058943     524352  256M 83 Linux
/dev/mmcblk2p3    1023,3,16   1023,3,16      1058944    7110591    6051648 2954M 83 Linux
/dev/mmcblk2p4    1023,3,16   1023,3,16      7110592    7634943     524352  256M 83 Linux

find device of your SD card in my case /dev/mmcblk0p1 , size of 59.4G

4.remove all partition in SD card ** Please note command line if there is some thing like p1 or p2 at the end for your drive path, remove it so in mycase just fdisk /dev/mmcblk0

fdisk /dev/mmcblk0

- then enter

d

to delete all partition

- use

p

to make sure that all partition are deleted

- enter

n
p
1

to create new primary partition

- use p to check it again now it should be 1 partition

- now use w to save

w

after done with fdisk now you have to create ext4 file system 

mkfs.ext4 /dev/mmcblk0p1

create mount folder

mkdir /mnt/ext_card
chmod 777 /mnt/ext_card

create udev rule

vi /etc/udev/rules.d/automount.rules

press i to switch vi to edit mode

and add following to the end of file

ACTION=="add" KERNEL=="mmcblk0p1" RUN+="/bin/mount /dev/mmcblk0p1"

press following key to save and exit

ESC
:
w
q
!

- then 

vi /etc/fstab

and add following to the end of file (same method as edit udev file

/dev/mmcblk0p1           /mnt/ext_card            ext4   defaults        0       0

-now restart UMC

- relogin to UMC

- stop server

- copy previous DB to sd card

cd /mnt/ext_card/
mkdir ir_db
chmod 777 ir_db
rsync --info=progress2 /var/lib/iRidium\ Server/DataBase/* /mnt/ext_card/ir_db/

then rename old database folder in umc

mv /var/lib/iRidium\ Server/DataBase /var/lib/iRidium\ Server/DataBase-local

and link SD card to IR database folder

ln -s /mnt/ext_card/ir_db /var/lib/iRidium\ Server/DataBase

- restart UMC again now everything should work

Hello.

Addition: manipulation of the database and the log files (copy, rename) you need to perform after stopping the iRidium server. Because you may not know that the server could be performing database maintenance and/or logging at this point. If the loss of the journal is not critical, it is better not to experiment with the database. To stop iRidium server correctly, you can use the button in the web interface "Stop Server".