This is a sneak-peek at one of the topics covered in the Server Admin best practices session at the Masters Summit for QlikView:
When doing QlikView Server deployments for clients, I often come across policies stating that the C: drive, the default installation drive for QlikView, may only be used for the operating system. Program files, data and logs all need to be placed on other, designated drives. The rationale for this policy is that data, and especially log files that aren’t purged, can fill up the boot drive and disrupt the system.
Specifying alternative locations for program files is simply a matter of specifying another installation path during setup, and the location of data and QVWs can be easily configured in the QMC. Moving log files is a little more complex however, so today I have for you a tutorial explaining two options for moving your log files and other configuration artifacts.
The two options for moving log files are:
- Modifying the configuration files
- Creating a symlink
Read on to see how to implement each solution, and when to use which solution.
Modify the configuration files
You can change the location of log files by modifying the .exe.config files, which hold configuration settings for the various server components. The key to change (or add, if it’s missing) is ApplicationDataFolder, as shown in the following image.
The default locations for the .exe.config files are:
- C:\Program Files\QlikView\Directory Service Connector\QVDirectoryServiceConnector.exe.config
- C:\Program Files\QlikView\Distribution Service\QVDistributionService.exe.config
- C:\Program Files\QlikView\Management Service\QVManagementService.exe.config
- C:\Program Files\QlikView\Server\Web Server\QVWebServer.exe.config
Do not forget to stop the services while you are modifying the files, create a backup, and copy the contents of the log/data folder to the new location.
You’ll notice that there is no .exe.config file for the QlikView Server (it’s not a .Net application). You can change the location of the QVS logs in the QMC, under System | Setup | QVS | Logging | Log Folder, as shown in the following image:
Unfortunately, this solution isn’t perfect, even after making all these changes you are still left with some artifacts in the C:\ProgramData\QlikTech directory. I’m writing this part of the post from memory, so I am not quite sure, but believe the artifacts had to do with the embedded webserver used by the QlikView Management Service. Feel free to correct me.
Create a symlink
If the previous option seems like a lot of work, you may appreciate the second option; creating a symlink. A symlink, or symbolic link, is a reference from one location to another. Just like a shortcut. You may have data stored in one folder and reference it from another folder using a symlink. Reading or writing files in the ‘symlinked’ folder behaves exactly the same as performing those operations on the folder the symlink is pointing to.
Or, to make it more concrete, say that you want to move your log files and program data from the standard location of C:\ProgramData\QlikTech to D:\QlikView\Config. The steps to achieve this using a symlink is:
- Stop all QlikView services
- Create the destination directory D:\QlikView\Config
- Open the command prompt with Administrator privileges and navigate to C:\ProgramData:
- c: (just in case)
Now when you do a directory listing of the C:\ProgramData folder, you’ll notice the QlikTech symlink is pointing to the D:\QlikView\Config folder, as shown in the following image.
The advantage of this solution is that the files were moved from the C: drive without requiring any configuration changes in QlikView. I like it!
Bonus tip: for those developers working on extensions, symlinks also come in handy to point the extension folders of QV Server and QV Desktop to a single folder. This ensures that the extensions you’re working on are immediately available for testing in both the Desktop and Server environments.
When to use what?
By default, I use the symlink option as it is much easier to implement. However, sometimes using a symlink is not possible, for example because IT policies forbid it (yes, I have had that happen). In that case, I modify the config files.
Voiding the warranty
Do be aware that both these options for moving log files are unsupported by QlikTech. Should you have any server issues then QT Support may require that you first undo the changes to the log file location. This is another reason I prefer the symlink option; it can be undone within 5 minutes. I’ve never actually ran into any support issues where I’ve had to undo the changes to the log file location however.
So what are your experiences? Is this a requirement you run into often? Do you want to read more about server admin? Let me know what you think by leaving a comment.