Windows Installation
This page installs Analytics Data Processing and Analytics API as Windows services. It applies to Analytics Data Processing v2.6.0 and later, and Analytics API v1.4.13 and later. Older versions have their own guides, see Older versions.
Read Installation first: it lists what you need, and how settings, the first run and upgrades work.
In the steps below, replace x.y.z with the version you install.
1. Prerequisites
- Install Microsoft ODBC Driver 18 for SQL Server. If the installation fails, install Microsoft Visual C++ Redistributable first.
- Download NSSM, and add the folder with
nssm.exeto the systemPATH. NSSM runs the services. - Get the package for each service from support. Each package contains the service
.exefile and awheelsfolder with the Python packages it installs. No internet access is needed.
The two services are installed the same way, but they do not behave the same in every detail. Check this table before you install, and see Differences between the services for what it means for you.
| Analytics Data Processing | Analytics API | |
|---|---|---|
| Service file | analytics_dp_service.exe | analytics_api_service.exe |
| Folder variable | BLIKSUND_ANALYTICS_DP_INITIAL_PATH | BLIKSUND_ANALYTICS_API_INITIAL_PATH |
| Install folder variable | PYAPP_INSTALL_DIR_BLIKSUND-DATA-PROCESSING-EWA | PYAPP_INSTALL_DIR_BLIKSUND-ANALYTICS-API-EWA |
| Windows service name | BliksundAnalyticsDP | Bliksund Analytics API Service |
Where .env is read from | The folder in the folder variable | The install folder, or one of its parent folders. Not the folder in the folder variable. |
| Where the service log is written | logs in the folder in the folder variable, or LOG__PATH | logs inside the install folder, or LOG__PATH if it is an absolute path |
| Where the install and NSSM logs are written | logs in the folder in the folder variable | logs in the folder in the folder variable |
| Restarts by itself if it stops | No | Yes |
| Starts when the server restarts | No | No |
| Port | N/A | Always 127.0.0.1:9090 |
2. Install a service
Install Analytics Data Processing first, then Analytics API. The steps are the same for both, with the names from the table above.
-
If an earlier version is running, stop it, see Stopping a service.
-
Unpack the package to a new folder for this version, for example
C:\ProgramData\BliksundAnalyticsDP\x.y.z. Keepwheelsnext to the.exefile. -
Set the system environment variable for the folder (
BLIKSUND_ANALYTICS_..._INITIAL_PATH) to that folder. The install command and NSSM write their logs tologsin it. Analytics Data Processing also reads its.envfile from it and writes its own log there. -
Set the system environment variable for the install folder (
PYAPP_INSTALL_DIR_...) to the folder where the service installs Python and its packages, for exampleC:\ProgramData\BliksundAnalyticsDP\installation\x.y.z. Use a new folder for each version: the last folder in the path must not exist yet. -
Create the
.envfile. Use the same settings as.env.data_processingand.env.apiin the Docker installation, and see the configuration reference for your version. When you upgrade, copy the.envfile from the previous version.- Analytics Data Processing: in the folder from step 2.
- Analytics API: in the install folder from step 4, after step 6 has created it. Also set
LOG__PATHto an absolute path, for exampleC:\ProgramData\BliksundAnalyticsAPI\x.y.z\logs, so the service log is not written inside the install folder.
-
Open PowerShell as administrator, go to the folder, and install the service. This can take a few minutes:
cd C:\ProgramData\BliksundAnalyticsDP\x.y.z
.\analytics_dp_service.exe installThe log shows the version when the service starts. If it shows another version, delete the install folder from step 4 and run the install command again.
-
Start the service:
.\analytics_dp_service.exe start
Keep the .env files private: they contain passwords and the API key.
Create the .env file before you start the service. The service reads it only when it starts.
3. First run
See First run. Look for Transformer completed! in the Analytics Data Processing service log, see Logging.
4. Upgrade
See Upgrading for the steps. To install a new version on Windows, repeat Install a service in a new folder. The install command replaces the Windows service of the previous version.
To go back to the previous version, stop the service, and run the install and start commands from the previous version's folder.
Running the services
Neither service starts by itself when the server starts. Start both again after a server restart.
If Analytics Data Processing stops, for example after an error, it stays stopped until you start it. Analytics API is started again by NSSM.
Restarting a service
In PowerShell as administrator, from the folder with the .exe file:
.\analytics_dp_service.exe stop
.\analytics_dp_service.exe start
Stopping a service
In PowerShell as administrator, from the folder with the .exe file of the running version:
.\analytics_dp_service.exe stop
To remove the service completely, run .\analytics_dp_service.exe remove after stopping it.
Logging
Each service writes several log files. See the table at the top for where they are.
service.log, or the name inLOG__FILE__FILENAME: the log of the service, rotated as set inLOG__FILE__MAX_SIZEandLOG__FILE__MAX_FILES.analytics_dp_service.out.logandanalytics_dp_service.err.log, oranalytics_api_service.out.logandanalytics_api_service.err.log: console output captured by NSSM. SetLOG__CONSOLE__ENABLED=falseif you do not want the service log repeated there.analytics_api_service.log(Analytics API only): the log of the install, start and stop commands.
For Analytics Data Processing, a relative LOG__PATH is relative to the folder in the folder variable. For Analytics API, it is relative to a folder inside the install folder, so use an absolute path.
Differences between the services
The Windows packages of the two services are built the same way, but have grown apart. Note the following:
.envlocation. Analytics Data Processing reads.envfrom the folder inBLIKSUND_ANALYTICS_DP_INITIAL_PATH. Analytics API v1.4.13 does not read.envfromBLIKSUND_ANALYTICS_API_INITIAL_PATH, as v1.1.0 did, but searches the install folder and its parent folders. If you upgrade from v1.1.0, move the.envfile. If Analytics API cannot connect to the database after an upgrade, check this first.- Service log. Analytics API writes its service log inside the install folder unless
LOG__PATHis an absolute path. - Restart. NSSM restarts Analytics API if it stops, but not Analytics Data Processing.
- Port. Analytics API always listens on
127.0.0.1:9090as a Windows service, so it is only reachable from the server itself.APP__PORThas no effect. Put a reverse proxy with HTTPS in front of it, see the FAQ. - Service names. The Windows service names follow different patterns:
BliksundAnalyticsDPandBliksund Analytics API Service. Use these names in the Windows Services console and withnssm.
With Docker, both services behave the same way, see Docker Installation.
Older versions
These versions are only available as Windows services, and each has its own installation guide: