Using MongoDB to store time series data
- Xibo for Android
- DSDevices DSCS9X/95 Set-up Guide
- Install a White Label or a different Player version on DSDevices
- CEC Screen Power on/off with DSDevices
- Hardware Recommendations
- Philips Signage SoC Monitors
- Sony Bravia SoC
- Hisense Commercial Displays SoC
- Managing Storage on the Android Device
- Player Settings
- Players without an Internet Connection
- Remote Administration with SS Helper
- Restart Rooted Device with a Shell Command
- Running Xibo for Android
- Resolving Common Issues
- Error shown when I try to licence my Player?
- Player not updating from the CMS?
- I can see my Licence entry but the Player appears unlicensed?
- Error message - Player is missing dependencies
- My scheduled Layouts are not working?
- Layout won't play? Splash screen plays?
- Watchdog error message
- Troubleshooting for Administrators
- Audit Trail
- Log Information
- Player Logs
- Getting the Player Status
- Request Player Status via CMS - Logged in Players only
- Request Player Status directly from a Device
- Can I use the Xibo name / logo?
- Can I run a Xibo Player on Raspberry Pi?
- How can I increase the upload file size limit?
- How do Players communicate with the CMS?
- How many displays can Xibo support?
- How do I reset the Xibo_admin account password?
- Power On/Off for Players
- Testing with Xibo
- Why do I need a Default Layout?
- Xibo for Android FAQ's
- Autoplaying Embedded Youtube Videos
- Closing to Home screen
- Displaying Images
- Embedded TV
- External SD card not listed when running Banana-Pi
- Helper Command to change Time zone
- HTML5 Video
- Memory Notifications
- Menu not accessible
- SSL Support
- Using Portrait Displays
- Video wont play properly
On this page
Using MongoDB to store Proof of Play and other time series data.
From v2.1 the CMS can be configured to use MongoDB to store Proof of Play statistics and other time series data.
MongoDB is enabled via the settings.php
file in the CMS installation. If Docker has been used settings.php
will not be accessible, however, it is possible to create a settings-custom.php
file in the /custom
mount point. The below Configuration can be added to that file instead.
Configuration
Please ensure you have Xibo version 2.1.0 or later before enabling MongoDB. You will also need to have a working MongoDB instance with a user and database created.
Add a new variable called $timeSeriesStore
to your settings file. The variable should be a function which returns a \Xibo\Storage\MongoDbTimeSeriesStore
created with your MongoDB connection details.
$timeSeriesStore = function() {
return new \Xibo\Storage\MongoDbTimeSeriesStore([
'host' => 'mongo',
'port' => '1234',
'database' => 'db_name',
'username' => 'user',
'password' => 'password'
]);
};
Mongo Indexes
We recommend adding an index to the stat
collection in your MongoDB database. To do this from the console, make sure you have your database selected and then:
db.stat.ensureIndex({ "start": -1, "end" : -1, "type": 1}, {background: true})
Migrating
Unless your CMS is a brand new installation you will likely have existing proof of play data which you want to move into MongoDB in a controlled fashion.
Xibo provides a migration task to achieve this which can be enabled by clicking on Tasks under the Administration section of the main CMS menu.
We have provided a set of default options for the task which you may want to adjust according to your environment. The default options intend to provide a slow and steady migration of your existing data.
Available options:
- killSwitch (0 or 1 to completely disable processing)
- numberOfRecords (how many to process each time)
- numberOfLoops (how many loops to do per task run)
- pauseBetweenLoops (how long to wait between each loop)
- optimiseOnComplete (issue an OPTIMIZE TABLE stat after truncating)
- configOverride (an optional path to a JSON file containing overrides for all of the above settings)
If you already use the StatsArchiver task it will be disabled during migration to prevent conflicts.
Nothing will be deleted from the stat
table in the MySQL database until the migration has completed.