microsoft / GraphEngine

Microsoft Graph Engine
http://www.graphengine.io/
MIT License
2.19k stars 328 forks source link

Have an issue running 2 instances of a Trinity console app? #376

Closed mwherman2000 closed 1 year ago

mwherman2000 commented 1 year ago

I'm overriding the ports properly, ...that's not the problem...

            TrinityConfig.HttpPort = nodePort;
#pragma warning disable CS0612 // Type or member is obsolete
            TrinityConfig.ServerPort = TrinityConfig.HttpPort + 1;
#pragma warning restore CS0612 // Type or member is obsolete

The problem seems to be because I'm running each instance out of the same "Debug" folder in Visual Studio. See below.

image

How can I override/specify which Trinity database folder to use? Is this what I need to be able to do?

NOTE: If I make a copy of my "Debug" folder and run an instance out of each folder, things appear to work fine.

Michael

TaviTruman commented 1 year ago

@mwherman2000 Each instance of the graph engine server must run on a separate IP port; you can't have each instance write to the same persistence store. There are at least two ways to configure the graph engine:

TaviTruman commented 1 year ago

Each GE App Server instance must run against its own configuration data. If you are running two servers then you may want to run them in a GE Availability Cluster. Here is an example of how I am doing so in one of dev environments:

<?xml version="1.0" encoding="utf-8" ?>
<Trinity ConfigVersion="2.0" xmlns="https://www.graphengine.io/schema/config">

    <!--Declare and Define the Head (Primary) Graph Engine Cluster-->
    <!-- <Local Template="primary-rub-truespark-sf-cluster-template"/>-->
    <!-- <Remote Template="rub-truespark-ontology-taxonomy-cluster-template"/>-->

    <!--A Cluster node contains configurations for servers and proxies of a Graph Engine cluster. 
        There can be multiple Cluster nodes as long as they have different identifiers. 
                        Endpoint="10.1.10.5:7001" 
        A Cluster node can have an optional attribute Id.-->

    <Local>
        <Network HttpPort="-1" 
            ClientMaxConn="2" 
            ClientSendRetry="5" 
            ClientReconnectRetry="5" 
            Handshake="TRUE"/>

        <Logging LogDirectory="D:\GraphEngine-Log" 
            LogLevel="Verbose" 
            LogToFile="TRUE" 
            EchoOnConsole="TRUE"/>

        <Storage TrunkCount="256"
            ReadOnly="FALSE" 
            StorageCapacity="Max16G" 
            StorageRoot="D:\GraphEngine-Storage" 
            DefragInterval="600"/>

        <LIKQ Timeout="90000" />
    </Local>

    <Cluster RunningMode="Server">
        <!-- genexusprime.inknowworksdev.net -->
        <Server Endpoint="10.1.10.5:7001" AssemblyPath="D:\Trinity TripleStore Server Deployment\">

            <Network HttpPort="-1" 
                ClientMaxConn="2" 
                ClientSendRetry="5" 
                ClientReconnectRetry="5" 
                Handshake="TRUE"/>

            <Logging LogDirectory="D:\GraphEngine-Log" 
                LogLevel="Verbose" 
                    LogToFile="TRUE" 
                EchoOnConsole="TRUE"/>

            <Storage TrunkCount="256"
                ReadOnly="FALSE" 
                StorageCapacity="Max16G" 
                StorageRoot="D:\GraphEngine-Storage" 
                DefragInterval="600"/>

            <LIKQ Timeout="90000" />

        </Server>

        <!-- TS-GE-AppSvrA1.rocketurbiz.net -->
        <Server Endpoint="10.30.10.108:7001" AssemblyPath="D:\Trinity TripleStore Server Deployment\">

            <Network HttpPort="-1" 
                ClientMaxConn="2" 
                ClientSendRetry="5" 
                ClientReconnectRetry="5" 
                Handshake="TRUE"/>

            <Logging LogDirectory="D:\GraphEngine-Log" 
                LogLevel="Verbose" 
                    LogToFile="TRUE" 
                EchoOnConsole="TRUE"/>

            <Storage TrunkCount="256"
                ReadOnly="FALSE" 
                StorageCapacity="Max16G" 
                StorageRoot="D:\GraphEngine-Storage" 
                DefragInterval="600"/>

            <LIKQ Timeout="90000" />

        </Server>

        <!-- TS-GE-AppSvrA1.rocketurbiz.net -->
        <Server Endpoint="10.30.10.113:7001" AssemblyPath="D:\Trinity TripleStore Server Deployment\">

            <Network HttpPort="-1" 
                ClientMaxConn="2" 
                ClientSendRetry="5" 
                ClientReconnectRetry="5" 
                Handshake="TRUE"/>

            <Logging LogDirectory="D:\GraphEngine-Log" 
                LogLevel="Verbose" 
                    LogToFile="TRUE" 
                EchoOnConsole="TRUE"/>

            <Storage TrunkCount="256"
                ReadOnly="FALSE" 
                StorageCapacity="Max16G" 
                StorageRoot="D:\GraphEngine-Storage" 
                DefragInterval="600"/>

            <LIKQ Timeout="90000" />

        </Server>
    </Cluster>
</Trinity>
mwherman2000 commented 1 year ago

It looks like the key (minimal) thing I need to do is have each instance specify it's own StorageRoot:

            <Storage TrunkCount="256"
                ReadOnly="FALSE" 
                StorageCapacity="Max16G" 
                StorageRoot="D:\GraphEngine-Storage" 
                DefragInterval="600"/>

I'm already overriding the ports. :-) Thank you.

mwherman2000 commented 1 year ago

Thank you