Start neo4j server with other configuration file - neo4j

I try to start neo4j on OSX and change the chosen configuration file. I'd like to start a test server for unit tests with a different port and a database, which shall be deleted while startup (I will solve the deletion part in a shell script, which should stop and start the server).
My problem is neo4j ignores the configuration file from the parameter. My call looks like this (from the terminal and the current folder is bin:
./neo4j start -server -Dorg.neo4j.server.properties=conf/neo4j-server-test.properties
The default configuration file is still chosen.
Thanks for your help

There are no 'ad hoc' arguments to the neo4j command script, so your arguments after start are ignored. You need to either make a modified version of the neo4j command script, or swap out neo4j-server.properties files.

You can use ineo to manage two or more Neo4j instances:
https://github.com/cohesivestack/ineo

You can specify the path to a folder containing a customized configuration file with an environment variable:
NEO4J_CONF=../conf neo4j start

Related

Why isn't telegraf reading environmental variables?

My goal is to put my telegraf config into source control. To do so, I have a repo in my user's home directory with the appropriate config file which has already been tested and proven working.
I have added the path to the new config file in the "default" environment variables file:
/etc/default/telegraf
like this:
TELEGRAF_CONFIG_PATH="/home/ubuntu/some_repo/telegraf.conf"
... as well as other required variables such as passwords.
However, when I attempt to run
telegraf --test
It says No config file specified, and could not find one in $TELEGRAF_CONFIG_PATH etc.
Further, if I force it by
telegraf --test --config /home/ubuntu/some_repo/telegraf.conf
Then the process fails because it is missing the other required variables.
Questions:
What am I doing wrong?
Is there not also a way of specifying a config directory too (I would like to break my file down into separate input files)?
Perhaps as an alternative to all of this... is there not a way of specifying additional configuration files to be included from within the default /etc/telegraf/telegraf.conf file? (I've been unable to find any mention of this in documentation).
What am I doing wrong?
See what user:group owns /etc/default/telegraf. This file is better used when running telegraf as a service via systemd. Additionally, if you run env do you see the TELEGRAF_CONFIG_PATH variable? What about your other variables? If not, then you probably need to source the file first.
Is there not also a way of specifying a config directory too (I would like to break my file down into separate input files)?
Yes! Take a look at all the options of telegraf with telegraf --help and you will find:
--config-directory <directory> directory containing additional *.conf files
Perhaps as an alternative to all of this... is there not a way of specifying additional configuration files to be included from within the default /etc/telegraf/telegraf.conf file? (I've been unable to find any mention of this in documentation).
That is not the method I would suggest going down. Check out the config directory option above I mentioned.
Ok, after a LOT of trial and error, I figured everything out. For those facing similar issues, here is your shortcut to the answer:
Firstly, remember that when adding variables to the /etc/default/telegraf file, it must effectively be reloaded. So for example using ubuntu systemctl, that requires a restart.
You can verify that the variables have been loaded successfully using this:
$ sudo strings /proc/<pid>/environ
where <pid> is the "Main PID" from the telegraf status output
Secondly, when testing (eg telegraf --test) then (this is the part that is not necessarily intuitive and isn't documented) you will have to ALSO load the same environmental variables into the current user (eg: SET var=value) such that running
$ env
shows the same results as the previous command.
Hint: This is a good method for loading the current env file directly rather than doing it manually.

Jenkins can't find file on the slave/agent?

I have changed our Jenkins setup from everything running on one machine to a master-agent/slave setup. Before that everything worked fine, now I am facing issues that some programs I am calling that access files can't find them.
Case 1:
(Pls don't ask why it is so complicated, but the file structure is given and I can't change it)
I am calling a python script, that iself calls a batch file
filepath= os.path.abspath(os.path.join(pamFolder, "run.bat"))
p = subprocess.Popen(filepath, cwd=pamFolder, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
... and the batch file again a jar file with the actual program
java -XX:-UseGCOverheadLimit -cp "../..;../../libs/*" -jar ..\..\myjarfile.jar
Within the jar file there is an access to a file on the disk failing with an error message that the file can't be found:
ERR : The file was not found in the specified path 'U:\somefile.txt'. Please check this path for access and your configuration!
Case 2:
I am calling a batch file from Jenkins that is calling some other exe and in the end trying to open a file in Excel via the COM interface. Here I am getting the following exception (Excel can't access the file):
Unhandled Exception: System.Runtime.InteropServices.COMException: Microsoft Excel kann auf die Datei 'D:\Jenkins\workspace\myJob\someDir\someFile.xlsm' nicht zugreifen.
Question
As previously mentioned, both jobs were working in the previous setup. Both files DO exist.
I suspect that Jenkins / the programs are trying to find the files on the master where they are not available.
Is there any way to tell Jenkins that the called tools are fully executed on the slave node or in some other way tell them where to find these files?
EDIT
The job is already running on the slave. The console shows Running on [slave name] in D:/Jenkins/workspace/xxxxx.
The master is configured in a way that only jobs assigned to it run on the master. So pretty much all jobs should run on the slave.
EDIT2 / SOLUTION
It turned out that the 2 issues are caused by different things.
Case1: Solved this by using the UNC path
Case2: Solved by a mixture of giving the necessary permissions as described here and starting the slave service with a user with admin rights.
From my experience with this issue, usually it has to do with your SCM setup.
But as you stated that the files DO exist I think there might be the possibility that U:\ is a network share? Then consider changing your path to use a UNC path.
If that's not the case check if your jenkins slave as sufficient user rights to access said file.
You can tell Jenkins to run the job on the designated slave as follows:
Under Nodes > [SLAVE] > Configure, specify a label for the slave.
Under [Job] > Configure > Restrict where this project can be run, enter the label.
Now when you build, the console output of the job should read correctly along the lines Running on [SLAVE] (build_agent_01) in C:/jenkins and the files must be accessible.

Not able to start Informix server

I am new to Informix. I installed Informix in the folder - /opt/Informix_Software_Bundle.
I am using the following command to start Informix server.
cd /opt/Informix_Software_Bundle
sudo ./oninit -i
And I am getting the following error message.
Unable to read $INFORMIXDIR (/usr/informix).
So I tried to set the environment variable INFORMIXDIR in ~/.profile as given below:
export INFORMIXDIR="/opt/Informix_Software_Bundle"
I also tried the following command:
INFORMIXDIR=/opt/Informix_Software_Bundle;export INFORMIXDIR
I tried logging out and in again. But nothing helped.
I will greatly appreciate if somebody can help me with this. Thanks for reading.
System - Mac OS Sierra
Informix version - 12.10
There are a number of environment variables used by the Informix server which include:
INFORMIXDIR : points to the directory where the product is installed. Add $INFORMIXDIR/bin to $PATH.
ONCONFIG : indicates the name of the main server configuration file in $INFORMIXDIR/etc. If not specified this will default to "onconfig."
INFORMIXSERVER : indicates the name of the Informix instance to connect to and refers to the DBSERVERNAME or a DBSERVERALIAS entry in the onconfig file referenced by $ONCONFIG.
INFORMIXSQLHOSTS : indicates the full path name of the communications configuration file used by Informix clients and servers. This will include an entry for the name specified by $INFORMIXSERVER. If this environment variable is not specified it defaults to $INFORMIXDIR/etc/sqlhosts.
Just having some or all of these environment variables set is not sufficient for starting an Informix server from scratch. There are setup tasks such as editing the onconfig file to specify the location of the root chunk - this is the initial location where the server stores its data. For more details you might like to refer to the Informix online documentation:
Getting started with IBM Informix
Overview of database server configuration and administration
One of the most straightforward ways to get started is to use the demonstration server instance that may be created during installation. I'm not directly familiar with the Mac OS installation but for all other platforms the Informix installation process includes an option to configure and initialize a demonstration server, and I suspect Mac OS will be the same. This will create an environment file in $INFORMIXDIR which will include settings for the variables named above.
One word of caution: the oninit command is used to both start the Informix server and initialize the chunks where the data is stored. The -i argument will perform the complete disk initialization which is precisely what you want for the first time the Informix server is started. On subsequent restarts you would not normally use this argument or else all the data stored by the server may be lost.
As sudo by default resets environment variables it is usual to have
A) A script to set the required environment variables for a given server.
B) Another wrapper script to start/stop the server.

Neo4j configuration file

I've tried to run a simple example "Hello World" with Neo4j but I don't know how to modify the configuration file.
I don't know what to put as a parameter for
"GraphDatabaseService graphDB = new GraphDatabaseFactory()
.newEmbeddedDatabase(" ..... ");"
and what other modification do I have to make. Do I have to put the org.neo4j.server.database.location from the neo4j-server.properties?
But first, do I have to run the server?
Thanks!
You can either put in the path from org.neo4j.server.database.location in the neo4j-server.properties file which will allow you to access the same database referred to when you run the server/webadmin.
Or you can put in the path to any directory that you have access to and your database will be created there.
You should not run the server since the above code uses Neo4j in embedded mode.

could not start the sphinx search service on local computer?

i am getting this
Windows could not start the SphinxSearch service on Local Computer.
Error 1067: The process terminated unexpectedly.
i got installation instruction from this .
http://blog.robbsnet.com/2011/07/how-to-install-and-implement-sphinx.html
build process is complete but when i start the sphinx search service i got errors .
Try running searchd manually from Command Prompt. Maybe it will give you a useful error message.
Try also looking in searchd.log
For anyone who is still having problems with the Windows service:
Make sure your configuration is correct for both database and paths and the needed folders & files are created.
Make sure that the service "command" matches the correct paths and files, to do so you have to:
Run administrative tools, click on local services, then find SphinxSearch. Click on its properties and read the line the service is trying to execute. If the configuration path doesn't match the service start command, it will fail to start.
FYI, this can also happen because your search data files are corrupt. Easy fix for that is to nuke the files and refill them.

Resources