Páginas filhas
  • CTree Bound Server with memory files

How to configure a balance of load using C-Tree Bound server with files in memory

Product:

Microsiga Protheus

Versions:

11 and 12

Step by Step:

C-tree BoundServer (c-tree Server DLL) is, basically, a c-tree server that starts along (embedded) with Protheus Server. We recommend its use in environments in which only one Protheus Server is used as application server, in which the access to dictionaries is not shared with other Protheus servers. You can configure it to load dictionary files (SXs) in the memory, making the access faster.

See below reference links of C-tree BoundServer documentation with technical information:

c-tree BoundServer

http://tdn.totvs.com/display/tec/c-tree+BoundServer

c-Tree Server with SXS in memory

http://tdn.totvs.com/pages/viewpage.action?pageId=208338982

Section cTreeServerMaster

http://tdn.totvs.com/pages/viewpage.action?pageId=208338976


Below the procedure showing how to configure the file appserver.ini and ctsrvr.cfg (of the folder Appserver) to use the C-Tree Bound Server with memory files:


Notification:

Only tables informed in the .ini configuration are notified by that Protheus server. In this configuration, specify the extension of the table. Only ISAM tables of the Ctree are specified. The notification system is not ready to work with files Superfile type (.SPF extension).

Important:

1. It is recommendable the binary to be updated.


2. Do not mix configuration files "ctsrvr.cfg" of CtreeServer with BoundServer. In the most recent versions of the binary, this files comes along with the Appserver folder

Note:


The Bound Server also uses Ctree licenses, as well as the Ctree Server. For further information on how to apply the key, check this link:

Application for License (ctreecsv.dll)


- Copy the root folder of the load balance, with the folders "Appserver" of Master and Slaves

- See an example of configuration of files:


APPSERVER.INI (MASTER)



Code Block
[General]
InstallPath=C:\TOTVS 12
CtreeMode=boundServer
Consolelog=1

[Drivers]
Active=TCP

[TCP]
TYPE=TCPIP
Port=1270

[LICENSECLIENT]
Server=localhost
Port=5555

[P12]
SourcePath=C:\TOTVS 12\Microsiga\protheus\apo\
RootPath=C:\TOTVS 12\Microsiga\protheus_data
CtreeRootPath=C:\TOTVS 12\Microsiga\protheus_data
StartPath=\system\
x2_path=
RpoDb=top
RpoLanguage=Portuguese
RpoVersion=120
LocalFiles=CTREE
Trace=0
localdbextension=.dtc

[DBAccess]
Alias=P12_1_14
Server=localhost
Database=MSSQL
Port=7890

[CtreeServerMaster]
ctUserId=ADMIN
ctUserPass=ADMIN
ctServerName=FAIRCOMS@localhost
memctUserId=ADMIN
memctUserPass=ADMIN
memctServerName=boundServer@localhost
Environments=P12
Files=sx3*.dtc,sx5*.dtc,sx6*.dtc,sx7*.dtc
ShowStatus=1

[ServerNetwork]
MasterConnection=0
Servers=Slave1,Slave2
 
[Slave1]
TYPE=TCPIP
Server=localhost
Port=1271
Connections=1

[Slave2]
TYPE=TCPIP
Server=localhost
Port=1272
Connections=1


CTSRVR.CFG (MASTER)

Code Block
SERVER_NAME			BOUNDSERVER
COMM_PROTOCOL		F_TCPIP
COMM_PROTOCOL		FSHAREMM
LOG_SPACE			96
CTSTATUS_SIZE		-1000000
SKIP_MISSING_FILES	YES
IDX_MEMORY			128 MB
DAT_MEMORY			128 MB
CONNECTIONS			150
CONSOLE				NO_MESSAGEBOX
CONSOLE				NO_SHUTDOWN_PROMPT 

APPSERVER.INI (SLAVES)

Code Block
[General]
InstallPath=C:\TOTVS 12
CtreeMode=boundClient
Consolelog=1

[Drivers]
Active=TCP

[TCP]
TYPE=TCPIP
Port=1271

[LICENSECLIENT]
Server=localhost
Port=5555

[P12]
SourcePath=C:\TOTVS 12\Microsiga\protheus\apo\
RootPath=C:\TOTVS 12\Microsiga\protheus_data
CtreeRootPath=C:\TOTVS 12\Microsiga\protheus_data
StartPath=\system\
x2_path=
RpoDb=top
RpoLanguage=Portuguese
RpoVersion=120
LocalFiles=CTREE
Trace=0
localdbextension=.dtc

[DBAccess]
Alias=P12_1_14
Server=localhost
Database=MSSQL
Port=7890

[CtreeServerMaster]
ctUserId=ADMIN
ctUserPass=ADMIN
ctServerName=FAIRCOMS@localhost
Environments=P12
Files=sx3*.dtc,sx5*.dtc,sx6*.dtc,sx7*.dtc
ShowStatus=1

CTSRVR.CFG (SLAVES)

Code Block
COMM_PROTOCOL		F_TCPIP
COMM_PROTOCOL		FSHAREMM
LOG_SPACE			96
CTSTATUS_SIZE		-1000000
SKIP_MISSING_FILES	YES
IDX_MEMORY			128 MB
DAT_MEMORY			128 MB
CONNECTIONS			150
CONSOLE				NO_MESSAGEBOX
CONSOLE				NO_SHUTDOWN_PROMPT 

Notes:

About the files configuration:
- In the appserver.ini file of the Master, in the section [General], the row CtreeMode must be =boundServer, then in the appserver.ini of


Appserver.ini:

[CtreeServerMaster]


Information to connect to CTREE SERVER MASTER:


ctUserId=ADMIN -> Row not required. The value "ADMIN" is Default.


ctUserPass=ADMIN -> Row not required. The value "ADMIN" is Default.


ctServerName=FAIRCOMS@localhost -> Name the main Ctree Server server (not embedded). The first part before the @ indicates the name of the server, defined in the row SERVER_NAME of the file ctsrvr.cfg do CtreeServer, while the second part, after the @, indicates the IP address of the server where this CtreeServer is.

Information to connect to CTREE BOUND SERVER:


memctUserId=ADMIN -> Row not required. The value "ADMIN" is Default.


memctUserPass=ADMIN -> Row not required. The value "ADMIN" is Default.


memctServerName=boundServer@localhost -> Name of the Ctree Bound Server server (embedded). The first part before the @ indicates the name of the server, defined in the row SERVER_NAME of the file ctsrvr.cfg do CtreeServer, which is in the folder Appserver, while the second part, after the @, indicates the IP address of the server where this Ctree Bound Server is.

Environments=P12 -> List of environments using the C-Tree Bound Server with files in memory. This key informs which environments of the server are checked, during the preparation of the environment of the process (Thread) of notification, to search files specified in the FILES configuration. You can only indicate for notification, environments using CTREE for the control of ISAM(SXS) tables.

Files=sx3990.dtc,sx5*.dtc,sx6??0.dtc,sx7*.dtc -> Files to be used in memory. You can specify one or more files, separated by comma, with absolute paths in disk, related to ROOTPATH of the environment, or only the name of the file found from STARTPATH of the environment. Use characters of the mask "*" and "?".

ShowStatus=1 -> Displays messages of Ctree notification information. It can be 0 or 1. Default is o.

  • Sem rótulos