Changing Storage location of Influxdb running as a windows service - windows-services

I am running running influxdb as a service on windows so the default directory for the data is (which is different than that mentioned in the config file and this is probably because I am running as a service)
C:\Windows\System32\config\systemprofile.influxdb\data
Is there any way to change the storage location? For example if I want the data to be stored in C:\Programfiles\Data can I make this work? Or more generally can you change the storage location of a windows service?

I have managed to change this on my system by setting the dir entry of the [data] section of influxdb.conf. For example:
dir = "/Influx/InfluxDB/.influxdb/data"
Puts my data directory in C:\Influx\InfluxDB\.influxdb\data.
FYI the reason it ends up in C:\Windows\System32\config\systemprofile.influxdb\data by default when running it as a service is because you are running the service as the Local System identity. Another way to change the location is to run the service as a specific named user, after which the default location for the data will be c:\Users\<username>\.influxdb\data\.

Check this so-hard-to-find-thing out, please: https://docs.influxdata.com/influxdb/v1.4/administration/config/#data-settings-data

Related

How to configure a writable folder inside an application published to Azure App Service using Docker for Windows

I'm working in an application to obtain some data from a web service, create a text file in the local filesystem send a command to a command line application, obtain the result and then send the results back via the web service.
I need to be able to write to the local file system, read from it and then delete the temporary file. I was reading about bind mounts and volumes but this folder can be delete if a new version of the image is uploaded is just a staging area.
Any ideas how this can be done, thanks.
When using containers in App Service, I believe you will have to link a storage account and mount file shares accordingly. Depending on the OS (windows / linux), the steps vary a bit.
If you are not using containers, then you should be able to access the temporary file locations for file-based requirements. Do note that the storage available this way is limited and not shared across site instances.

Switch active database with Neo4j docker image

I have imported my data to a new Neo4j database instead of the standard graph.db using import tool. I want to switch this database to web Neo4j. I used Neo4j docker image with /var/lib/neo4j volume. But I can't find my config file to change the active database, even after I mount conf directory specifically this file doesn't get generated.
How can I switch active Neo4j database in web client or neo4j shell?
Here is the command with which I created neo4j container:
docker run --publish=7474:7474 --publish=7687:7687 --volume=/var/lib/neo4j/import:/var/lib/neo4j/import --env=NEO4J_dbms_allow_upgrade='true' --env=NEO4J_dbms.security.allow_csv_import_from_file_urls='true' neo4j:latest
You cannot change the active database of a live Neo4J instance.
Enterprise edition does allow for some values to be changed without rebooting; the keys allowed to be changed this way are listed at the online documentation, but dbms.active_database is not one of them.
Instead, you have a few options.
You can mount a /conf directory
The conf directory can be filled with configuration files that will completely override the default ones. They are not generated by Neo4J, you must take an entire neo4j.conf file and place it in the directory which is then mounted to the container. You can change whatever values you need to in that file.
After the mapped directory is updated with the new file, you will need to bounce your image (or exec a bounce of neo4j from within the image).
You can set the active database with an environment variable
Similar to how you've passed in the other environment variables, you can pass in other configuration options. If your new database was called newgraph.db and it resided in the same directory as graph.db, you would need only to pass in --env=NEO4J_dbms_active__database=newgraph.db. If it resides in a different directory, give that directory with --env=NEO4J_dbms_directories_data=/path/to/new/data/dir.
As these are passed as environment variables, changing them requires starting a new Docker image.
You could also build your own image.
The final and perhaps most drastic option would be to create your own image that is based off of neo4j's image and has all of the changes that you need. Typically, this would not be required, but if you want to clean up your invocation of docker and not keep around any mapped configuration directories, this is the way to go. It would also ensure anybody who has your custom image needs no additional configuration; whether this is desirable is up to you and your deployment architecture.

Restart a process inside a Docker container whenever the config file changes

I have a DockerFile that starts 2 processes in a single docker container using a jar file and a config file as an argument
java -jar process1.jar process1.cfg &
java -jar process2.jar process2.cfg
process1.cfg and process2.cfg are residing in mounted directories. Now whenever there is a change in any of the cfg files, I would need to restart the corresponding process for the new change to take effect. All these to be done programmatically using Java in a REST microservice that updates the config file and restarts the process. Any idea on how to go about it ?
The problem can be generically solved by your Java app starting a config change monitoring service/thread, which manages the actual business service/thread(s) by starting it in the beginning and restarting on any change (if the change actually needs a restart). File change monitoring is standard Java functionality. The solution does not need any REST, it is not bound to microservice architecture (although it is more sensible within it) and it is not limited by or to docker containers.
If you do not want any file-based configs, do the same, but the monitoring bit can be e.g. a vert.x-based web server listening for external REST requests supplying configs, on start or for any update. The rest remains the same.
In my current workplace we actually have a module that functions in exactly this way, it is deployed to a docker and uses both file system monitoring and vert.x web server for config changes.
You can even go further and make the monitoring bit start multiple instances internally if multiple configs need to be supported.

How do you create a shared folder to the host using vSphere?

VMWare player and workstation has the ability to easily create a shared folder directly to the host:
http://www.vmware.com/support/ws5/doc/ws_running_shared_folders.html
This feature seems to be missing or is moved in vSphere. How do you set it up in vSphere?
Thanks.
Actually, we can't have shared folders using ESXi. But we can workaround it by creating a folder in the host datastore and copying files from/to it using scp protocol. Of course, you need to have administrative privileges on the host for that.
This link explains how to set up SSH Server and Shell Access on ESXi:
http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.vcli.migration.doc_50%2Fcos_upgrade_technote.1.4.html
This feature doesn't make sense with vSphere, which is why you can't find it.
Workstation, Player, Server all run on top of a "host OS" while ESX (vSphere managed) runs on bare-metal. You're not supposed to have access to the native file system on the host - so there is no option to do so.

Running multiple executables from a windows service

I would like to achieve the following. I have a C# server application which is run by a Windows Service. The service currently requires that the server application is located in a specific directory.
Is it possible to create a Windows Service that takes a directory at start and run the application in that directory? How do you do that?
Can such a "configurable" service be used to start multiple application (executables with same name but located in different directories). This would be used to run different versions of a server application in parallel. Or do you need one service per running instance?
Yes, simply set the context to reflect the desired environment.To do this use Environment.SetEnvironmentVariable.
A single service can start many applications, each with its environment. Use a configuration file or persistent data in the registry.

Resources