Data exchange between several servers¶
In complex options of system deployment it’s sometimes required to install and configure several StaffCop Servers with the ability to exchange data between remote servers and the central one. To perform this task it’s required to configure the remote server for sending data to the central server and choose the time of sending data (usually out of working hours).
Configure the central server:¶
Open Admin -> Control panel -> Server settings and enable option API access is enabled by changing the value to Yes
Copy the value of API key
Configure a remote server (slave server which will pass data to the central server):¶
Open Admin -> Control panel -> Server settings and specify the IP address of the central server in Master server
Insert the copied API key value into Master server API key
Run the following command in Linux console
echo "SAVE_REPORTS=True" | sudo tee -a /etc/staffcop/config
Wait until data is accumulated on the server and run the command:
staffcop upload --all
The server on which the command is running will connect to the Master server with API key and upload there all the accumulated.
It makes sense to use crontab to schedule this operation for night hours or weekends when there’s not much load on the communication channel between the central and remote servers.
Note
Only events will be transferred from the slave server to the master one, files will not be transferred.
Note
After transferring data from a slave server to the master one the last transferred event ID is kept and the next transferring will start from the event following the last transferred.