Rundeck job to transfer a file to a remote node - rundeck

I am trying to transfer a file through sftp in rundeck to a remote node.It fails the job execution
with the error Failed: WrongParameter: sourcePath has to be a directory.
my jod definition looks like this
<joblist>
<job>
<defaultTab>nodes</defaultTab>
<description></description>
<dispatch>
<excludePrecedence>true</excludePrecedence>
<keepgoing>false</keepgoing>
<rankOrder>ascending</rankOrder>
<successOnEmptyNodeFilter>false</successOnEmptyNodeFilter>
<threadcount>1</threadcount>
</dispatch>
<executionEnabled>true</executionEnabled>
<id>8b7a993e-441d-4073-9e88-5ec801950a43</id>
<loglevel>INFO</loglevel>
<name>mytestjob2</name>
<nodeFilterEditable>false</nodeFilterEditable>
<nodefilters>
<filter>172.105.34.168</filter>
</nodefilters>
<nodesSelectedByDefault>true</nodesSelectedByDefault>
<scheduleEnabled>true</scheduleEnabled>
<sequence keepgoing='true' strategy='node-first'>
<command>
<description>ftp file</description>
<node-step-plugin type='copyfile'>
<configuration>
<entry key='destinationPath' value='/root/destination/' />
<entry key='echo' value='true' />
<entry key='recursive' value='true' />
<entry key='sourcePath' value='/root/source/' />
</configuration>
</node-step-plugin>
</command>
</sequence>
<uuid>8b7a993e-441d-4073-9e88-5ec801950a43</uuid>
</job>
</joblist>
Can you tell me where am I going wrong ? how should I suppy the source directory to rundeck.

You must set the temp path in "Source Path" textbox with ${file.Upload} and set the file name on "Destination Path" textbox using "${file.Upload.fileName}" (like cp/mv UNIX command).
I leave a job definition that works (tested on Rundeck 3.3.1):
<joblist>
<job>
<context>
<options preserveOrder='true'>
<option name='Upload' type='file' />
</options>
</context>
<defaultTab>output</defaultTab>
<description></description>
<dispatch>
<excludePrecedence>true</excludePrecedence>
<keepgoing>false</keepgoing>
<rankOrder>ascending</rankOrder>
<successOnEmptyNodeFilter>false</successOnEmptyNodeFilter>
<threadcount>1</threadcount>
</dispatch>
<executionEnabled>true</executionEnabled>
<id>6df7eb26-7f0f-46ed-bb60-cec9eb21b28b</id>
<loglevel>INFO</loglevel>
<name>UploadJob</name>
<nodeFilterEditable>false</nodeFilterEditable>
<nodefilters>
<filter>name: remote</filter>
</nodefilters>
<nodesSelectedByDefault>true</nodesSelectedByDefault>
<scheduleEnabled>true</scheduleEnabled>
<sequence keepgoing='false' strategy='node-first'>
<command>
<node-step-plugin type='copyfile'>
<configuration>
<entry key='destinationPath' value='/home/user/${file.Upload.fileName}' />
<entry key='echo' value='true' />
<entry key='recursive' value='false' />
<entry key='sourcePath' value='${file.Upload}' />
</configuration>
</node-step-plugin>
</command>
</sequence>
<uuid>6df7eb26-7f0f-46ed-bb60-cec9eb21b28b</uuid>
</job>
</joblist>
Here the result.

Related

LOG4Net: Cannot find Property [additivity] to set object on [log4net.Appender.RollingFileAppender]

Any help would be appreciated.
I am using GCP Kubernetes Engine.
Getting following error in POD:
log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [additivity] to set object on [log4net.Appender.RollingFileAppender]
Here is my configuration file:
apiVersion: v1
kind: ConfigMap
metadata:
name: log4net-config
namespace: bold-services
data:
Log4Net.config: |
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<log4net threshold="ALL" debug="true">
<root>
<level value="ALL" />
<!-- <appender-ref ref="ConsoleAppender" /> -->
<appender-ref ref="FILE_DEBUG_APPENDER" />
<appender-ref ref="FILE_ERROR_APPENDER" />
</root>
<!-- === File Appender for NON-ERROR messages file === -->
<appender name="FILE_DEBUG_APPENDER" type="log4net.Appender.RollingFileAppender" class="ch.qos.logback.classic.AsyncAppender">
<file type="log4net.Util.PatternString" value="%property{AppDataPath}/logs/%property{loggername}/debug-info-%env{HOSTNAME}.txt" />
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<additivity value="true" />
<appendToFile value="true" />
<maxSizeRollBackups value="1" />
<maximumFileSize value="300KB" />
<rollingStyle value="Size" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<header type="log4net.Util.PatternString" value="#Software: %property{loggername} %newline#Date: %date %newline#Fields: date thread namespace methodname message %newline" />
<conversionPattern value="%date [%thread] %message%newline" />
</layout>
</appender>
<!-- === File Appender for ERROR messages file === -->
<appender name="FILE_ERROR_APPENDER" type="log4net.Appender.RollingFileAppender" class="ch.qos.logback.classic.AsyncAppender">
<file type="log4net.Util.PatternString" value="%property{AppDataPath}/logs/%property{loggername}/errors-%env{HOSTNAME}.txt" />
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="ERROR" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<additivity value="true" />
<appendToFile value="true" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="100KB" />
<rollingStyle value="Size" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<header type="log4net.Util.PatternString" value="#Software: %property{loggername} %newline#Date: %date %newline#Fields: date thread namespace methodname message %newline" />
<conversionPattern value="%date [%thread] %-5level %message%newline" />
</layout>
</appender>
<!-- === Console Appender to use in BufferingForwardingAppender === -->
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern type="log4net.Util.PatternString" value="%newline%%-5level %property{loggername} %env{HOSTNAME} %%date [%%thread] %%message%newline" />
</layout>
</appender>
</log4net>
</configuration>

Rundeck Powershell pass options to script

My question is how do I pass options/ parameter into a PowerShell script? Could not find it on the docs or any other good post about it. I know it's possible because I saw it in a video from the rundeck YouTube channel.
Using inline script just add #option.youroption#, make sure to fill the right params to execute in your windows box. I leave a couple of examples, take a look:
Job definition (inline PowerShell script):
<joblist>
<job>
<context>
<options preserveOrder='true'>
<option name='opt1' />
</options>
</context>
<defaultTab>nodes</defaultTab>
<description></description>
<dispatch>
<excludePrecedence>true</excludePrecedence>
<keepgoing>false</keepgoing>
<rankOrder>ascending</rankOrder>
<successOnEmptyNodeFilter>false</successOnEmptyNodeFilter>
<threadcount>1</threadcount>
</dispatch>
<executionEnabled>true</executionEnabled>
<id>700b58f6-9bae-4d97-b97d-dd4c7efba9ca</id>
<loglevel>INFO</loglevel>
<name>JobWINRM</name>
<nodeFilterEditable>false</nodeFilterEditable>
<nodefilters>
<filter>name: windows</filter>
</nodefilters>
<nodesSelectedByDefault>true</nodesSelectedByDefault>
<scheduleEnabled>true</scheduleEnabled>
<sequence keepgoing='false' strategy='node-first'>
<command>
<exec>echo "hi"</exec>
</command>
<command>
<fileExtension>.ps1</fileExtension>
<script><![CDATA[Write-Host "#option.opt1#"]]></script>
<scriptargs />
<scriptinterpreter>powershell.exe</scriptinterpreter>
</command>
</sequence>
<uuid>700b58f6-9bae-4d97-b97d-dd4c7efba9ca</uuid>
</job>
</joblist>
Using "external script" passing some parameter in "Arguments" textbox.
Powershell script:
### hello.ps1 ###
Param($Variable1 = "Hello", $Variable2 = "World")
"$Variable1 $Variable2"
Rundeck Job definition:
<joblist>
<job>
<context>
<options preserveOrder='true'>
<option name='opt1' />
</options>
</context>
<defaultTab>nodes</defaultTab>
<description></description>
<dispatch>
<excludePrecedence>true</excludePrecedence>
<keepgoing>false</keepgoing>
<rankOrder>ascending</rankOrder>
<successOnEmptyNodeFilter>false</successOnEmptyNodeFilter>
<threadcount>1</threadcount>
</dispatch>
<executionEnabled>true</executionEnabled>
<id>854a8639-ad98-4520-b446-359ec2eaf531</id>
<loglevel>INFO</loglevel>
<name>JobWINRMEXT</name>
<nodeFilterEditable>false</nodeFilterEditable>
<nodefilters>
<filter>name: windows</filter>
</nodefilters>
<nodesSelectedByDefault>true</nodesSelectedByDefault>
<scheduleEnabled>true</scheduleEnabled>
<sequence keepgoing='false' strategy='node-first'>
<command>
<exec>echo "hi"</exec>
</command>
<command>
<fileExtension>.ps1</fileExtension>
<scriptargs>"${option.opt1}"</scriptargs>
<scriptfile>/home/user/scripts/hello.ps1</scriptfile>
<scriptinterpreter>powershell.exe</scriptinterpreter>
</command>
</sequence>
<uuid>854a8639-ad98-4520-b446-359ec2eaf531</uuid>
</job>
</joblist>

Start OrientDB studio for plocal DB

I'm able to start my orientDb (2.2.6) instance using a plocal connection and able to add vertices to the DB but I can't access the studio. When I go to http://localhost:2480, the page is blank. Isn't studio ready and available 'out of the box'?
orientdb-server-config.xml is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<orient-server>
<network>
<protocols>
<protocol implementation="com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary" name="binary"/>
<protocol name="http" implementation="com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpDb"/>
</protocols>
<listeners>
<listener protocol="binary" socket="default" port-range="2424-2430" ip-address="0.0.0.0"/>
<listener protocol="http" port-range="2480-2485" ip-address="0.0.0.0">
<commands>
<command implementation="com.orientechnologies.orient.server.network.protocol.http.command.get.OServerCommandGetStaticContent" pattern="GET|www GET|studio/ GET| GET|*.htm GET|*.html GET|*.xml GET|*.jpeg GET|*.jpg GET|*.png GET|*.gif GET|*.js GET|*.css GET|*.swf GET|*.ico GET|*.txt GET|*.otf GET|*.pjs GET|*.svg">
<parameters>
<entry value="Cache-Control: no-cache, no-store, max-age=0, must-revalidate\r\nPragma: no-cache" name="http.cache:*.htm *.html"/>
<entry value="Cache-Control: max-age=120" name="http.cache:default"/>
</parameters>
</command>
</commands>
</listener>
</listeners>
</network>
<users>
<user resources="*" password="root" name="root"/>
<user resources="connect,server.listDatabases,server.dblist" password="guest" name="guest"/>
</users>
<properties>
<entry value="1" name="db.pool.min"/>
<entry value="50" name="db.pool.max"/>
<entry value="true" name="profiler.enabled"/>
</properties>
</orient-server>
I get these warnings whenever I try to access localhost:2480 from Chrome:
2016-09-28 16:56:01:756 WARNI path variable points to 'src/site' but it doesn't exists [OServerCommandGetStaticContent]
2016-09-28 16:56:01:756 WARNI path variable points to 'src/site' but it isn't a directory [OServerCommandGetStaticContent]
What am I missing?

WSO2 ESB unable to remove ws-security header in the response before DSS call

I have a proxy service which needs to call a exernal service with ws security. I have to
call the service, and based on the response, I need to extract some information
and then call a data service to update the database. As I get the response and create the
payload to call the data service it is also having the ws security header which ends up in an exception.
I have used
<header action="remove" name="wsse:Security" scope="default"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" />
while creating and calling the data service but end up with no luck.
Below is my proxy service.
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="EDI_Test_Proxy_2" startOnLoad="true" trace="disable"
transports="http https" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<header name="Action" scope="default" value="get_mcash_data" />
<property name="Content-Type" scope="transport" type="STRING"
value="application/soap+xml; charset=UTF-8; action=get_mcash_data" />
<call>
<endpoint>
<address trace="disable"
uri="http://localhost:9770/services/my_fetch_data_service" />
</endpoint>
</call>
<property expression="//mc:mcash/mc:tran_id/text()" name="tran_id"
scope="default" type="STRING" xmlns:mc="http://ws.wso2.org/dataservice"
xmlns:ns="http://org.apache.synapse/xsd" />
<log level="custom">
<property expression="$ctx:tran_id" name="tran_id" />
</log>
<filter xmlns:mc="http://ws.wso2.org/dataservice" xmlns:ns="http://org.apache.synapse/xsd"
xpath="boolean(//mc:mcash/mc:mobile_no)">
<then>
<property expression="//mc:mcash/mc:tran_id/text()" name="tran_id"
scope="default" type="STRING" />
<property expression="//mc:mcash/mc:mobile_no/text()"
name="mobile_no" scope="default" type="STRING" />
<property expression="//mc:mcash/mc:tran_amt/text()" name="tran_amt"
scope="default" type="STRING" />
<property expression="//mc:mcash/mc:tran_date/text()"
name="tran_date" scope="default" type="STRING" />
<property expression="//mc:mcash/mc:tran_time/text()"
name="tran_time" scope="default" type="STRING" />
<property expression="//mc:mcash/mc:part_tran_srl_num/text()"
name="part_tran_srl_num" scope="default" type="STRING" />
<log level="custom">
<property expression="$ctx:tran_id" name="tran_id" />
<property expression="$ctx:mobile_no" name="mobile_no" />
<property expression="$ctx:tran_amt" name="tran_amt" />
<property expression="$ctx:tran_date" name="tran_date" />
<property expression="$ctx:tran_time" name="tran_time" />
<property expression="$ctx:part_tran_srl_num" name="tran_time" />
</log>
<payloadFactory description="pf_mcash" media-type="xml">
<format>
<flw:purchaceFromMMR xmlns:flw="http://flw.mwt.mobitel.com/">
<!--Optional: -->
<bankPurchaseRequest xmlns="">
<amount>$1</amount>
<!--Optional: -->
<bankCode>XXX</bankCode>
<!--Optional: -->
<date>$2</date>
<!--Optional: -->
<mobile>$3</mobile>
<!--Optional: -->
<time>$4</time>
<!--Optional: -->
<transactionId>$5</transactionId>
</bankPurchaseRequest>
</flw:purchaceFromMMR>
</format>
<args>
<arg evaluator="xml" expression="$ctx:tran_amt" />
<arg evaluator="xml" expression="$ctx:tran_date" />
<arg evaluator="xml" expression="$ctx:mobile_no" />
<arg evaluator="xml" expression="$ctx:tran_time" />
<arg evaluator="xml" expression="$ctx:tran_id" />
</args>
</payloadFactory>
<call>
<endpoint>
<address trace="disable"
uri="https://my_external_web_service/to_be/called?wsdl">
<enableSec policy="gov:ws-policy/sample_policy.xml" />
</address>
</endpoint>
</call>
<loopback />
</then>
<else>
<log>
<property name="STATUS" value="*****No data available*****" />
</log>
</else>
</filter>
</inSequence>
<outSequence>
<header action="remove" name="wsse:Security" scope="default"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" />
<header action="remove" name="To" scope="default" />
<property expression="//return/mobile/text()" name="mobile"
scope="default" type="STRING" />
<property expression="//return/date/text()" name="date"
scope="default" type="STRING" />
<property expression="//return/recipetNo/text()" name="recipetNo"
scope="default" type="STRING" />
<property expression="//return/resultCode/text()" name="resultCode"
scope="default" type="STRING" />
<property expression="//return/resultDesc/text()" name="resultDesc"
scope="default" type="STRING" />
<payloadFactory description="pf_mcash_update"
media-type="xml">
<format>
<p:TestUpdate xmlns:p="http://ws.wso2.org/dataservice">
<!--Exactly 1 occurrence -->
<p:trf_status>$1</p:trf_status>
<!--Exactly 1 occurrence -->
<p:resp_code>$2</p:resp_code>
<!--Exactly 1 occurrence -->
<p:receipt>$3</p:receipt>
<!--Exactly 1 occurrence -->
<p:rsp_message>$4</p:rsp_message>
<!--Exactly 1 occurrence -->
<p:tran_id>$5</p:tran_id>
<!--Exactly 1 occurrence -->
<p:part_tran_srl_num>$6</p:part_tran_srl_num>
</p:TestUpdate>
</format>
<args>
<arg value="10" />
<arg evaluator="xml" expression="$ctx:resultCode" />
<arg evaluator="xml" expression="$ctx:recipetNo" />
<arg evaluator="xml" expression="$ctx:resultDesc" />
<arg value="SDC311521" />
<arg evaluator="xml" expression="$ctx:part_tran_srl_num" />
</args>
</payloadFactory>
<header name="Action" scope="default" value="TestUpdate" />
<property name="Content-Type" scope="transport" type="STRING"
value="application/soap+xml; charset=UTF-8; action=TestUpdate" />
<call>
<endpoint>
<address trace="disable"
uri="http://my_internal_data_service/which_ends_up_with/ws_sec_header" />
</endpoint>
</call>
</outSequence>
<faultSequence />
</target>
</proxy>
Any advice is very much appreciated.
Can you add the following log mediator before the call mediator in the outsequence and update this with the output logs.
it will help us to identify the issue.
<log level="full">
<property name="OutSequence" value="==== OUTSEQ ===="/>
</log>
The issue was I have engaged rampart module <module ref="rampart" /> in the axis2.xml found in <ESB_HOME>repository/conf/axis2/ . After commenting out this line the exception was gone and the dss call worked. The reason I believe, if this line of code is enabled, ws-securiy is engaged globally and all the service calls will look for ws-security header. Please correct me if I'm wrong in anyway.

How to setup embedded master/master replication with OrientDB?

My goal is to have two nodes. Node A should write some vertices and node B should be able to read those vertices.
So far my hazelcast discovery works just fine. OrientDB will also hot deploy any found database from nodeA to nodeB. Unfortunately any write on Node A will not be replicated to nodeB.
My setup:
orientdb-server-config.xml:
Simplified version (copied from orientdb-community tar.gz)
%NODENAME% will be replaced with nodeA or nodeB.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<orient-server>
<handlers>
<handler
class="com.orientechnologies.orient.graph.handler.OGraphServerHandler">
<parameters>
<parameter name="enabled" value="true" />
<parameter name="graph.pool.max" value="50" />
</parameters>
</handler>
<!-- CLUSTER PLUGIN, TO TURN ON SET THE 'ENABLED' PARAMETER TO 'true' -->
<handler
class="com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin">
<parameters>
<parameter name="nodeName" value="%NODENAME%" />
<parameter name="enabled" value="true" />
<parameter name="configuration.db.default"
value="config/default-distributed-db-config.json" />
<parameter name="configuration.hazelcast" value="config/hazelcast.xml" />
</parameters>
</handler>
</handlers>
<network>
<sockets>
<socket
implementation="com.orientechnologies.orient.server.network.OServerSSLSocketFactory"
name="ssl">
<parameters>
<parameter value="false" name="network.ssl.clientAuth" />
<parameter value="config/cert/orientdb.ks" name="network.ssl.keyStore" />
<parameter value="password" name="network.ssl.keyStorePassword" />
<parameter value="config/cert/orientdb.ks" name="network.ssl.trustStore" />
<parameter value="password" name="network.ssl.trustStorePassword" />
</parameters>
</socket>
<socket
implementation="com.orientechnologies.orient.server.network.OServerSSLSocketFactory"
name="https">
<parameters>
<parameter value="false" name="network.ssl.clientAuth" />
<parameter value="config/cert/orientdb.ks" name="network.ssl.keyStore" />
<parameter value="password" name="network.ssl.keyStorePassword" />
<parameter value="config/cert/orientdb.ks" name="network.ssl.trustStore" />
<parameter value="password" name="network.ssl.trustStorePassword" />
</parameters>
</socket>
</sockets>
<protocols>
<!-- Default registered protocol. It reads commands using the HTTP protocol
and write data locally -->
<protocol name="binary"
implementation="com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary" />
<protocol name="http"
implementation="com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpDb" />
</protocols>
<listeners>
<listener protocol="binary" ip-address="0.0.0.0" port-range="2424-2430"
socket="default" />
<!-- <listener protocol="binary" ip-address="0.0.0.0" port-range="2434-2440"
socket="ssl"/> -->
<listener protocol="http" ip-address="0.0.0.0" port-range="2480-2490"
socket="default">
<parameters>
<!-- Connection's custom parameters. If not specified the global configuration
will be taken -->
<parameter name="network.http.charset" value="utf-8" />
<parameter value="true" name="network.http.jsonResponseError" />
<!-- Define additional HTTP headers to always send as response -->
<!-- Allow cross-site scripting -->
<!-- parameter name="network.http.additionalResponseHeaders" value="Access-Control-Allow-Origin:
*;Access-Control-Allow-Credentials: true" / -->
</parameters>
<commands>
<command
pattern="GET|www GET|studio/ GET| GET|*.htm GET|*.html GET|*.xml GET|*.jpeg GET|*.jpg GET|*.png GET|*.gif GET|*.js GET|*.css GET|*.swf GET|*.ico GET|*.txt GET|*.otf GET|*.pjs GET|*.svg GET|*.json GET|*.woff GET|*.woff2 GET|*.ttf GET|*.svgz"
implementation="com.orientechnologies.orient.server.network.protocol.http.command.get.OServerCommandGetStaticContent">
<parameters>
<!-- Don't cache html resources in development mode -->
<entry name="http.cache:*.htm *.html"
value="Cache-Control: no-cache, no-store, max-age=0, must-revalidate\r\nPragma: no-cache" />
<!-- Default caching -->
<entry name="http.cache:default" value="Cache-Control: max-age=120" />
</parameters>
</command>
<command pattern="GET|gephi/*"
implementation="com.orientechnologies.orient.graph.server.command.OServerCommandGetGephi" />
</commands>
</listener>
</listeners>
<cluster>
</cluster>
</network>
<!-- <storages> <storage name="db_%NODENAME%" path="%DB_PATH%" userName="admin"
userPassword="admin" loaded-at-startup="true" /> </storages> -->
<users>
<user name="root" password="finger" resources="*" />
<user name="admin" password="finger" resources="*" />
</users>
<properties>
<!-- DATABASE POOL: size min/max -->
<entry name="db.pool.min" value="1" />
<entry name="db.pool.max" value="50" />
<!-- PROFILER: configures the profiler as <seconds-for-snapshot>,<archive-snapshot-size>,<summary-size> -->
<entry name="profiler.enabled" value="true" />
<!-- <entry name="profiler.config" value="30,10,10" /> -->
<entry name="plugin.directory" value="%PLUGIN_DIRECTORY%" />
<!-- LOG: enable/Disable logging. Levels are: finer, fine, finest, info,
warning -->
<entry name="log.console.level" value="%CONSOLE_LOG_LEVEL%" />
<entry name="log.file.level" value="%FILE_LOG_LEVEL%" />
</properties>
</orient-server>
default-distributed-db-config.json:
{
"autoDeploy": true,
"hotAlignment": true,
"executionMode": "synchronous",
"readQuorum": 1,
"writeQuorum": 1,
"failureAvailableNodesLessQuorum": false,
"readYourWrites": true,
"servers": {
"*": "master"
},
"clusters": {
"internal": {
},
"index": {
},
"*": {
"servers": ["<NEW_NODE>"]
}
}
}
Start OServer:
OServer server = OServerMain.create();
server.startup(getOrientServerConfig());
server.activate();
Wait until both nodes have been started.
Each node connects to the graph database.
OrientGraphFactory factory = new OrientGraphFactory("plocal:" + new File("databases/db_testdb").getAbsolutePath());
NodeA will add new vertices using getNoTx.
NodeB will just read the graph and count the found vertices using getNoTx.
I created a very basic maven project which contains two tests that will start nodeA and nodeB.
It is mandatory to set the ORIENTDB_HOME property for each node. The property must be set that way so that the $ORIENTDB_HOME/databases folder can be located. I have updated the maven project.
Each node can set the property for example this way:
String orientdbHome = new File("").getAbsolutePath();
System.setProperty("ORIENTDB_HOME", orientdbHome);