Skip to main content

System requirements

Requirements to run the FairCom Server

Abstract

The FairCom server is intended to run with minimal system requirements. This section lists those requirements.

The FairCom server is intended to run with minimal system requirements. This section lists those requirements.

Note

Some configuration options can impact resource requirements, such as memory; by adjusting these options, you can keep requirements to a minimum.

Section

Description

Supported platforms

This section lists supported platforms for Windows, Linux, and macOS.

Hardware requirements

This section lists the minimum, recommended, and large enterprise hardware requirements.

Java version

This section describes what Java version FairCom DB SQL requires and where to obtain it.

FairCom server for Windows

This section provides the hardware/software requirements and installation/configuration procedures for Windows.

FairCom server for Mac

This section provides the hardware/software requirements and installation/configuration procedures for the Macintosh.

FairCom DB Unix & Linux servers

This section provides the hardware/software requirements and installation/configuration procedures for Unix/Linux systems.

  • Windows

    • Intel 32- and 64-bit

    • Windows server 2008 and later

    • Windows 7 or newer

  • Linux

    Note

    FairCom has long supported all common Linux distributions.

    Please inquire about specific versions should you have unique requirements.

    • Intel 64-bit

    • ARM 32- and 64-bit

    • Red Hat Enterprise Linux 8 and 7 and compatible CentOS releases, and other Linux distributions

    • Raspberry Pi OS

    Note

    FairCom servers can also run on the following systems:

    • AIX

    • FreeBSD

    • HP-UX

    • QNX and QNX RTP

    • Solaris (Intel and SPARC)

    • SCO 6

  • macOS

    • Big Sur 11

    • Catalina 10.15

    • Mojave 10.14

  • Minimum hardware requirements:

    • 1 GHz CPU

    • 1 GB RAM

    • 2 GB Disk space

      Note

      • This is the space required to install all features as well as minimal space for transaction logs, data files, and index files. These features include FairCom’s web applications, command line utilities, tutorials, plugins, etc.

      • FairCom products have a modular design that makes it easy to shrink storage requirements to 120 MB or less. For more information, contact FairCom.

  • Recommended hardware requirements:

    • 2 GHz CPU

    • 8 GB RAM

    • 2 GB Disk space + space for data and indexes

  • Support for large enterprise hardware:

    • Unlimited number of CPUs with many cores

    • Terabytes of RAM

    • Petabytes of storage

FairCom provides software development kits (SDKs) and tutorials for its JSON, SQL, ISAM, and CTDB APIs. These SDKs and tutorials are tested in the following integrated developer environments (IDEs) for the listed software development languages.

Supported software development languages include:
  • Java

  • Python

  • JavaScript

  • C#

  • Visual Basic

  • C

  • C++

  • PHP

  • SQL, ODBC, JDBC

Microsoft Visual Studio

FairCom provides SDKs and tutorials for C, C++, C#, and Visual Basic that work in the listed versions of Microsoft Visual Studio.

Supported Microsoft Visual Studio versions
  • VS2022

  • VS 2019

  • VS 2017

  • VS 2015

  • Prior Visual Studio versions may be available by contacting FairCom.

Visual Studio Code

FairCom provides SDKs and tutorials for Python and JavaScript that work in Visual Studio Code.

JetBrains

FairCom provides SDKs and tutorials for Java, Python, and JavaScript that work in the listed JetBrains IDEs.

Supported JetBrains IDEs:
  • IntelliJ IDEA

  • PyCharm

  • WebStorm

Python development

FairCom products support Python for multiple features:
  • FairCom’s JSON APIs work on all Python versions because they simply send and receive JSON over HTTP and HTTPS.

  • MQTT works on Python 3.

JavaScript development

FairCom products support Java for multiple features:
  • FairCom’s JSON APIs work on all Java versions because they simply send and receive JSON over HTTP and HTTPS.

  • MQTT works on Java versions 1.8 and later, see FairCom’s MQTT tutorial for Java.

  • SQL Stored Procedures, Triggers, and User Defined Functions can be written in Java. They require Java 1.7 or newer.

  • JDBC supports Java 1.6 or newer.

  • FairCom’s c-treeDB API for Java requires Java 1.6 or newer.

  • On Windows, SQL Stored Procedures, triggers, and user-defined functions written in Java require the Java Virtual Machine (jvm.dll), which may require MSVCR100.DLL.

    Note

    • The Java installer does not install MSVCR100.DLL. You can install the Visual C++ 2010 Redistributable package to install MSVCR100.DLL.

    • Be sure to install the 64-bit or 32-bit version of the Visual C++ 2010 Redistributable package to match the 32-bit or 64-bit version of your Java SDK installation.

Java is readily available from the Oracle Java downloads website. FairCom DB supports Java on any platform that the Java environment is currently available, including Windows, AIX, Oracle Sun, and Linux.

Contact FairCom for the latest Java compatibility announcements and availability of the latest Java support.

.NET development

FairCom products support .NET for multiple features:
  • FairCom’s JSON APIs work on all .NET versions because they simply send and receive JSON over HTTP and HTTPS.

  • MQTT works on all .NET versions.

  • SQL Stored Procedures, triggers, and user-defined functions can be written in C# and VB. They require Microsoft .NET Framework 4 or newer.

C and C++ development

FairCom products support C and C++ for multiple features:
  • FairCom’s JSON APIs work on all C and C++ platforms because they simply send and receive JSON over HTTP and HTTPS.

  • MQTT works on C and C++ compilers.

Microsoft Visual Studio

FairCom provides SDKs and tutorials for C, C++, C#, and Visual Basic that work in the listed versions of Microsoft Visual Studio.

Supported Microsoft Visual Studio versions
  • VS2022

  • VS 2019

  • VS 2017

  • VS 2015

  • Prior Visual Studio versions may be available by contacting FairCom.

Visual Studio Code

FairCom provides SDKs and tutorials for Python and JavaScript that work in Visual Studio Code.

JetBrains

FairCom provides SDKs and tutorials for Java, Python, and JavaScript that work in the listed JetBrains IDEs.

Supported JetBrains IDEs:
  • IntelliJ IDEA

  • PyCharm

  • WebStorm

Python development

FairCom products support Python for multiple features:
  • FairCom’s JSON APIs work on all Python versions because they simply send and receive JSON over HTTP and HTTPS.

  • MQTT works on Python 3.

JavaScript development

FairCom products support Java for multiple features:
  • FairCom’s JSON APIs work on all Java versions because they simply send and receive JSON over HTTP and HTTPS.

  • MQTT works on Java versions 1.8 and later, see FairCom’s MQTT tutorial for Java.

  • SQL Stored Procedures, Triggers, and User Defined Functions can be written in Java. They require Java 1.7 or newer.

  • JDBC supports Java 1.6 or newer.

  • FairCom’s c-treeDB API for Java requires Java 1.6 or newer.

  • On Windows, SQL Stored Procedures, triggers, and user-defined functions written in Java require the Java Virtual Machine (jvm.dll), which may require MSVCR100.DLL.

    Note

    • The Java installer does not install MSVCR100.DLL. You can install the Visual C++ 2010 Redistributable package to install MSVCR100.DLL.

    • Be sure to install the 64-bit or 32-bit version of the Visual C++ 2010 Redistributable package to match the 32-bit or 64-bit version of your Java SDK installation.

Java is readily available from the Oracle Java downloads website. FairCom DB supports Java on any platform that the Java environment is currently available, including Windows, AIX, Oracle Sun, and Linux.

Contact FairCom for the latest Java compatibility announcements and availability of the latest Java support.

.NET development

FairCom products support .NET for multiple features:
  • FairCom’s JSON APIs work on all .NET versions because they simply send and receive JSON over HTTP and HTTPS.

  • MQTT works on all .NET versions.

  • SQL Stored Procedures, triggers, and user-defined functions can be written in C# and VB. They require Microsoft .NET Framework 4 or newer.

C and C++ development

FairCom products support C and C++ for multiple features:
  • FairCom’s JSON APIs work on all C and C++ platforms because they simply send and receive JSON over HTTP and HTTPS.

  • MQTT works on C and C++ compilers.

FairCom DB SQL requires the Java 1.7 JDK and JRE environment for Stored Procedures, Triggers, and User Defined Functions (UDFs), JDBC, and c-treeDB Java (FairCom DB SQL V11.0 requires 1.6 or newer).

Java is readily available from the Oracle Java downloads website. FairCom DB supports Java on any platform that the Java environment is currently available, including Windows, AIX, Oracle Sun, and Linux.

Check with FairCom for the latest Java compatibility announcements and availability of the latest Java support.

Windows users, see Using Java 1.7 or later on Windows.

This section provides the hardware/software requirements and installation/configuration procedures for Windows.

FairCom DB Windows SQL server

Minimum CPU and memory requirements for operating the SQL version of the FairCom DB SQL Server for Windows:
  • 1 GHz CPU

  • 1 GB RAM

  • 250 MB Disk space + space for your data + index files (assuming default 120 MB transaction LOG_SPACE setting in ctsrvr.cfg)

FairCom DB Windows ISAM server

Minimum CPU and memory requirements for operating the ISAM version of the FairCom server for Windows:
  • 80 MHz CPU

  • 300 MB RAM

  • 200 MB Disk space + space for your data + index files (assuming default 120 MB transaction LOG_SPACE setting in ctsrvr.cfg)

Note

Additional memory will be needed for additional users beyond 16 concurrent users and larger data and index caches.

Cache sizes larger than 2GB require a 64-bit version of the OS and a 64-bit version of FairCom DB. It is possible to reduce the memory requirements below these recommended settings. Please contact your nearest FairCom office for details.

FairCom DB requirements:
  • Windows 7 or Windows server 2008 or newer.

    Note

    Windows Vista or 2003 and some earlier versions of Windows may be supported if necessary. Check with FairCom for possible availability.

  • For ADO.NET support, you will need Microsoft .NET Framework 4 or newer.

  • For the V11.5 FairCom DB SQL JDBC Driver you will need JDK 1.7 or newer and the FairCom DB SQL server to develop using JDBC.

  • For the V11.0 FairCom DB SQL JDBC Driver you will need JDK 1.6 or newer and the FairCom DB SQL server to develop using JDBC.

  • Stored procedures for the FairCom DB SQL server:

    • To develop a stored procedure, you will need JDK 1.7 or newer.

    • To execute a stored procedure, you will need JRE 1.7 or newer.

  • Stored procedures for the V11.0 FairCom DB SQL server:

    • To develop a stored procedure, you will need JDK 1.6 or newer.

    • To execute a stored procedure, you will need JRE 1.6 or newer.

One of the FairCom DB GUI Tool implementations (located by default in \FairCom\V*\Win*\tools\guitools) requires the following versions of Microsoft .NET framework to be available:
  • FairCom DB V11.5 requires Microsoft .NET 4.0 Framework.

  • FairCom DB V11.0 requires Microsoft .NET 4.0 Framework.

  • FairCom DB V10.3 requires Microsoft .NET 4.0 Framework.

Note

FairCom DB V10 requires at least framework version 3.5 SP1 complete — for example, the complete version, not just the "client" version.

.NET - Removed STRONGSIGN from assemblies

To be more compliant with standard practice for C# programmers, STRONGSIGN has been removed from .NET assemblies. We no longer force the assembly to be signed with the FairCom key. This allows developers to sign with their own key, which they can keep secret.

.NET tools for VS2010 - all projects updated to use .NET framework v4.0

All the .NET projects for VS2010 have been updated to use the v4.0 .NET framework. If you target the .NET v3.5 framework, it uses the VS2008 compiler tool chain which can result in an internal compiler error in VS2010. The target framework was changed to v4.0 in the *_v10.sln files to eliminate that error.

For more information, see http://support.microsoft.com/kb/976656

System requirements

The minimum development system requirements for FairCom DB QL ADO.NET Entity Framework support:

Note

The complete version is required — for example, the complete version, not just the "client" version.

  • Visual Studio 2008 Service Pack 1 or greater

  • FairCom DB V11.5 requires Microsoft .NET 4.0 Framework.

  • FairCom DB V11.0 requires Microsoft .NET 4.0 Framework.

  • FairCom DB V10.3 requires Microsoft .NET 4.0 Framework.

  • FairCom DB V10 requires at least Framework Version 3.5 SP1

Auto Incrementing field type restriction

Entity Framework Models allow Int16, Int32 or Int64 field types to be specified as Auto Incrementing in model design. Auto Incrementing fields are also known as Identity fields in some schemas.

FairCom DB SQL allows one user Auto Incrementing field type.

Note

FairCom DB already supported a serial segment field, currently used by default as the ROWID value. As there is a limitation of one SRLSEG field type per data file (table), this precluded the addition of a user-defined field. An IDENTITY attribute is now available for this purpose.

Other known limitations

Known FairCom DB SQL limitations that can be encountered when using Entity Framework support:

Note

These are in various stages of development. Contact your nearest FairCom office for the latest information concerning specific support for these items.

  • The SKIP operator is not currently supported. The SKIP operator is commonly used with the TOP operator for "paging" purposes.

  • The EXCEPT operator is not currently supported.

  • Parameters are not currently supported in functions and in the TOP operator.

  • BIT (Boolean) columns can currently only be tested against 1 or 0 (that is, if ( bitColumn == 1 ). Entity Framework requires a test against true/false (for example, if ( bitColumn == true) or more simply if ( bitColumn ).

When the server configuration file contains the CONSOLE TOOL_TRAY keyword, the FairCom server starts in background, displaying only a FairCom DB icon in the Windows tool tray. This feature is especially nice for ‘simple’ user sites, with no system administrative expert. Although more sophisticated sites will prefer running the FairCom server as a service, this feature gives a similar ‘service-like’ background effect, without the user needing to learn Windows service administration.

Add the keyword CONSOLE TOOL_TRAY to your server configuration file, ctsrvr.cfg.

Note

This keyword is not supported when the server is running as a service.

The FairCom server for Windows accepts the ‘&’ symbol, or the "^&” for Windows server, as a command line parameter to execute in CONSOLE TOOL_TRAY mode.

Example 1. Launch the server in "background-tool-tray" mode
C:\server>  ctreeace &

or

C:\server>  ctsrvr &


This section provides the hardware/software requirements and installation/configuration procedures for Unix/Linux systems.

Supported platforms

Currently supported FairCom DB Unix servers:
  • AIX

  • FreeBSD

  • HP-UX

  • Linux (Intel, PPC, and Sparc)

  • Mac OS X

  • QNX and QNX RTP

  • Solaris (Intel and SPARC)

On Unix platforms, the FairCom server is installed by following the same general method and, for the most part, share the same hardware requirements. Items specific to a particular FairCom server are discussed in Unix server platform hardware requirements.

Should you require support on other platforms, contact FairCom. FairCom DB has been ported to dozens of platforms over the years. Generally, all that is required is a supported C compiler, and for best multithreading support, a native pthread library. Even without native thread support, FairCom can provide a proprietary threading architecture.

Unix server platform hardware requirements

The requirements for the FairCom server on each listed operating system are presented in the following topics.

The minimum hard drive space required by the FairCom server for Unix is:
  • The size of the FairCom server executable

  • + the amount specified by the LOG_SPACE keyword (10 MB default)

  • + 1MB for the FairCom server status logs

  • + size of pre-compiled FairCom utilities

  • + the size of the data (.dat) and index (.idx) files

The minimum memory requirements for operating the FairCom server for all Unix systems are:
  • FairCom DB SQL server: 1 GB RAM

  • FairCom DB server: 300 MB RAM

Note

Additional memory will be needed for additional users beyond 16 concurrent users and larger data and index caches. Cache sizes larger than 2GB require a 64-bit version of the OS and a 64-bit version of the FairCom server.

It is possible to reduce the memory requirements below these recommended settings. For details, please contact FairCom.

The HP-UX 11 operating system, and above, supports standard FairCom DB files up to 4 GB in size and allows huge files. Earlier versions support 2GB file sizes and requires segmented files to support larger files.

For proper operations of the FairCom server under various loads, FairCom recommends adjusting the following kernel parameters of the HP/UX 11 system, using the sam utility:
  • Increase maximum per-process stack memory size (maxssiz) from the default of 8 MB to 128 MB.

  • Increase maximum per-process data memory size (maxdsiz) from the default of 64 MB to 256 MB.

  • Consider increasing the number of threads per process if connecting a large number of clients. The default for older releases of the OS is relatively low (64 maximum threads per process).

  • Either increase the default number of file handles from 60 to 256 by using sam or, prior to starting the FairCom DB SQL process, issue limit descriptors 256 to increase the number of file descriptors used by that process only.

FairCom has enjoyed multi-threaded support from nearly our inception and has extensive engineering experience in supporting various threading architectures that have appeared through the years. POSIX pthread support is considered the industry standard in recent times, and we highly encourage taking advantage of this support when at all possible. By default, all FairCom DB servers include pthread support when available on a chosen platform.

For platforms not supporting a native threading technology, FairCom supports a proprietary threading library. FairCom recommends native thread support when available as performance enhancements are typical.

Note

The Native Thread server supports only the TCP/IP communications protocol.

The FairCom server for Linux requires a Pentium 133, Sparc, or PPC CPU.

The FairCom server for IBM AIX requires a minimum of 500 MB RAM. FairCom DB V11* supports AIX 6.1 and newer. Earlier versions of AIX may also be available. Contact FairCom for availability for AIX versions prior to V6.

The FairCom server supports Solaris Version 2.10 and newer and both the SPARC and X86/X64 based CPU. Earlier versions of Solaris may also be available. Contact FairCom for availability for Solaris versions prior to 2.10.

Shared Memory client-server communication for Unix/Linux

The FairCom server for Unix supports shared memory connections. Shared memory communication between clients and servers residing on the same machine generally provides much better performance for locally running applications. Local shared memory connections are supported across the board including ISAM and SQL connections, and this includes JDBC and Windows ADO.NET Data providers.

Include the following server configuration in ctsrvr.cfg to enable this support:

COMM_PROTOCOL FSHAREMM

Note

  • FairCom client libraries are compiled with this feature enabled by default.

  • The COMM_PROTOCOL option specifies the protocol used for ISAM connections. By default, local SQL connections use shared memory unless the SQL_OPTION NO_SHARED_MEMORY keyword is specified. See the c-tree SQL server operations and utilities guide for more information about the communication protocol for SQL connections.

The FairCom shared memory communication protocol creates a file used by clients to find the shared memory identifier for its shared memory logon region, and creates a Unix domain socket as a file for initial communication between a client and server.

The FairCom server creates the directory /tmp/ctreedbs and the file /tmp/ctreedbs/<servername>.logon. This file name is determined by the value specified with the SERVER_NAME configuration option. This file contains an identifier of a shared-memory region used for clients to connect.

Important

SERVER_PORT applies to the TCP/IP protocol and overrides SERVER_NAME if both are used together.

The following configuration option allows this directory to be directly specified:

SHMEM_DIRECTORY <directory_name>
If your server combines shared memory and TCP/IP usage, here are a few tips:
  • If you are content with the TCP/IP port resulting from the SERVER_NAME option, then use that option and you can connect using the name with either protocol.

  • If you wish to explicitly set the TCP/IP port, use SERVER_PORT to set that port (then connect with #port to use TCP/IP on that port) and SERVER_NAME to set the name used by the shared memory protocol. Note that this approach means that a connection attempt will not be able to 'fall back' to using TCP/IP if the shared memory connection fails, unless you choose your server name so that it matches your SERVER_PORT setting. For example, consider the following set of options:

    SERVER_PORT 7000
    
    SERVER_NAME #7000

Connect with a server name of #7000. The client will attempt to connect using shared memory first and if that fails it will connect with TCP/IP on port 7000.

Note

On some Linux/Unix systems, be sure to place double quotes around the connection string (for example when using the bash shell).

For example: ./ctstat -vas -u admin -p ADMIN -s "#5598ocalhost"Without the double quotes, bash treats # as a comment, so it ignores the remainder of the connection string.

FairCom DB must have sufficient read, write, create, and delete permissions with this directory.

The following server keyword sets the shared memory resource permissions:

SHMEM_PERMISSIONS <permissions>

The default is 660. 666 will allow access to FairCom DB by any user account.

By default, a client application must belong to the server owner’s primary group to use shared memory. This is configurable with the SHMEM_GROUP keyword.

SHMEM_GROUP  <group>
Example 2. Possible errors indicating problems
FSHAREMM: Could not get group ID for group <group> for shared memory

FSHAREMM: Failed to set group for LQMSG shared memory region: X


Shared memory keys

When more than one FairCom process is run on a Unix system, the shared memory key used by the servers might hash to the same value, causing problems connecting to the servers. This happens as the ftok() system call is used by default to generate the shared memory keys, and ftok() is not guaranteed to return unique values. Another possibility is that another unrelated process might happen to use the same shared memory key as generated by the FairCom Server.

An administrator can specify a specific shared memory key for ISAM and SQL shared memory communication protocols to ensure that keys do not match keys already in use on the system. This is specified with the following FairCom configuration options:

SHMEM_KEY_ISAM <isam_shared_memory_key>

SHMEM_KEY_SQL <sql_shared_memory_key>

The shared memory key values can be specified in either decimal or hexadecimal format, for example:

; Set shared memory key for ISAM connections to the specified decimal value:

SHMEM_KEY_ISAM 12345

; Set shared memory key for ISAM connections to the specified hexadecimal value:

SHMEM_KEY_ISAM 0xabcd

These server configuration options support specifying an environment variable, whose value is substituted for the configuration option value when the server starts up. For example, if the environment variable MY_ISAM_KEY is set to a numeric value such as 12345 or 0xabcdef before starting the server process, then the following option can be specified in the server configuration file to use this environment variable value for the SHMEM_KEY_ISAM configuration option value:

SHMEM_KEY_ISAM %MY_ISAM_KEY% 

From the client side, either set the global variable ctshmemdir to the directory name before connecting, or set the CTREE_SHMEM_DIRECTORY environment variable. The environment variable takes precedence over the ctshmemdir setting. This allows the directory to be dynamically overridden without having to recompile client code.

The FairCom server logs error messages to CTSTATUS.FCS when a shared-memory connection attempt fails.

The message is of the form:

FSHAREMM: <error message>

When running the FairCom server with more than 128 shared-memory connections, you may encounter one of the following errors:

FSHAREMM: Connect named pipe failure: 13

FSHAREMM: Connect named pipe failure: 28

Many Unix/Linux implementations have a default limit of 128 system semaphores, which are used by FairCom shared memory connections. However, this value applies system-wide among all processes.

FSHAREMM: Failed to create system semaphore: check system semaphore limits such as SEMMNI

The following error can be reported as well:

FSHAREMM: Failed to create shared memory segment: check shared memory limits such as SHMMNI

These are typically kernel configurations. The FairCom server requires (2 + # shared memory CONNECTIONS) shared memory segments (SHMMNI) and semaphores (SEMMNI).

The ipcs command displays current limits:

#ipcs -l

------ Semaphore Limits --------

max number of arrays = 128

------ Shared Memory Limits --------

max number of segments = 128

To increase limits to allow up to 1024 shared memory segments and semaphores, consider adding the following to your local /etc/sysctl.conf file.

kernel.shmmni = 1024

kernel.sem = 250 256000 32 1024

Run this command to then enable support:

/sbin/sysctl -p

Note

In general, you will require root superuser access to make these changes. Consult your specific Unix/Linux documentation for the actual file location and parameters of this configuration.

To take advantage of this feature, check the following:
  1. Shut down your FairCom server and add the following keyword to your ctsrvr.cfg file:

    COMM_PROTOCOL FSHAREMM 
    
  2. Restart the FairCom server.

  3. Execute any FairCom utility you've linked with V9.5 or later of the FairCom server you have on the same machine as the FairCom server process. Even if you are linked with a c-tree TCP/IP library, it will automatically detect if you are running on the same machine and try to connect via shared memory. This way you don't need multiple versions of your application and utilities.

  4. You can monitor your connections by listing the clients from the ctadmn command-line utility on Linux, or by using the FairCom DB Monitor program from Windows (it is shown in the Comm Info column on the far right).

  • Unix and Windows client libraries are built with shared-memory support by default.

  • When the FairCom server detects a request to connect from the same machine as the client, it first attempts to connect using shared memory. If that succeeds, the connection uses the shared-memory protocol. Otherwise, the connection is made using TCP/IP.

  • 32-bit clients can connect to 64-bit servers (and vice versa).

  • By default, a client application must belong to the server owner’s primary group to use shared memory. This is configurable with the SHMEM_GROUP keyword.

  • Shared memory uses a Unix domain (file system) socket for transferring data between the client and server. The Unix domain socket exists as a file named /tmp/ctreedbs/<servername>.logon.

    Note

    The COMPATIBILITY SHMEM_PIPE option has been deprecated and no longer has any effect.

  • A Unix/Linux server using shared-memory communications will create a directory /tmp/ctreedbs. If this directory already exists (for example, if a different user had started the server, even from a previous run) and the server does not have write permission to this directory, startup will fail, most likely reporting a DSRV_ERR error (509, duplicate server), even if no other server is currently running.

  • pthread mutex shared-memory support is expected for Unix systems. However, if a client and the server are compiled with incompatible options (for example, the client uses System V semaphores but the server uses pthread mutexes) the connection attempt will fail and the FairCom server will log one of the following messages to CTSTATUS.FCS.

If client is using System V semaphore and server is using pthread mutex:

A shared-memory connection attempt by an incompatible client failed: pthread mutex required

If server is using System V semaphore and client is using pthread mutex:

A shared-memory connection attempt by an incompatible client failed: SYSV sema required

The Unix/Linux ipcs utility is useful for listing the shared-memory regions and semaphore sets that currently exist on a system. ipcs can also be used to remove shared-memory regions and semaphore sets. Under normal circumstances, the FairCom server removes shared-memory regions and semaphore sets for connections that have been closed. However, if the FairCom server process terminates abnormally, it may be necessary to manually remove the shared-memory regions and semaphore sets belonging to this process.

FairCom ISAM and SQL ports are independent of each other. In general, there is a shared memory connection protocol enabled for each, in addition to TCP/IP ports. Keep in mind that's a total of four connection protocols, with configuration options for each.

Possible SQL shared memory connection errors can appear such as the following. Analyze and correct these as you would for the ISAM errors previously mentioned as the same parameters should be examined.

Possible SQL share memory connection errors:
- User# 00012   sqlshmlisten: shared memory protocol initialization failed: -1

- User# 00012   sqlshmlisten: shared memory protocol accept failed: -2

- User# 00012   sqlshmlisten: Failed to get shared memory environment: XX
  • Named pipe creation failed with error ERROR_PIPE_BUSY. The operation will be retried.

    - User# 00012   sqlshmlisten: shared memory protocol listen failed: -4
  • Failed permissions on the temporary directory needed.

    - User# 00012   SQLSHAREMM: Failed to open /tmp/ctreedbs/CTSQL_6597 for shared memory: 13

Orphan shared memory segments and semaphores contribute to the system limit. Their presence can affect the number of user connections you will be able to achieve. There is no way of ensuring these are removed if the server process exits unexpectedly, so they must be removed manually.

To remove orphan shared memory segments and semaphores, follow this procedure:
  1. List the shared memory segments and the number of attached processes (NATTACH):

    ipcs -m -o

    Note

    • This shows all the shared memory segments on the system. Ones with no attached processes might be safe to remove.

    • Be careful not to delete the shared memory segments created by other processes. Deleting a shared memory segment that is in use does not cause an immediate problem for c-tree. This is similar to deleting a file that is open: any process using it can keep using it, but no one can start using it.

  2. Use the ipcrm command to remove unwanted shared memory segments and semaphores. Consult the manpage on your system for specific details about using this command.

  3. List the interprocess semaphores using the ipcs -s command.

    For Solaris 5.10, see List interprocess semaphores on Solaris 5.10 below.

    Note

    Solaris does not provide a way to see which interprocess semaphores belong to a specific process. To get an idea of whether a semaphore might be in use, use ipcs -s -t to see the time of last use. You may be able to infer which semaphores belong to c-tree by the time of last use (especially if you can shut down c-tree cleanly and observe the change in semaphores).

  4. Delete any unwanted interprocess semaphores.

    Note

    Deleting an interprocess semaphore if it is actively in use by c-tree causes the connection to immediately fail. Deleting an interprocess semaphore that is in use by another process may cause that process to fail.

  5. Start the server and connect to it once you have removed the items shown above.

Raising the limits on Solaris 5.10 and later
The following parameters are useful for managing resources:
  • max-shm-ids - Maximum number of shared memory segments on a system

  • max-sem-ids - Maximum semaphore IDs for a project.

  • max-sem-nsems - Maximum number of semaphores allowed per semaphore set.

Temporarily raise the limits set for these parameters
  1. Run the following as root, where SHELL_PID is the PID of the shell that will be starting the c-tree server process:

    prctl -n project.max-shm-ids -r -v 1024 -i project default
    
    prctl -n project.max-sem-ids -r -v 1024 -i project default
    
    prctl -n process.max-sem-nsems -r -v 1024 SHELL_PID
  2. Start FairCom server from the shell with PID = $SHELL_PID and connect users.

  3. The above settings will be reset to the default when the machine is rebooted.

    Note

    Remember that max-sem-nsems is only increased for that shell process and its children

  4. To make these changes permanent so they are effective after every reboot, execute the following command:

    /usr/sbin/projmod -sK "project.max-shm-ids=(privileged,1024,deny)" default
  5. After changing the shared memory parameters, you may need to delete orphaned shared memory segments as described above.

List interprocess semaphores on Solaris 5.10

Solaris 5.10 (and later) has a different method for capturing the current number of semaphores:

  1. Run the following command:

    prctl -n project.max-shm-ids $$
    Example 3. Output
    /export/home/fctech$ prctl -n project.max-shm-ids $$
    
    process: 3636: -tcsh
    
    NAME    PRIVILEGE       VALUE    FLAG   ACTION       RECIPIENT
    
    project.max-shm-ids
    
            privileged        128       -   deny                 -
    
            system          16.8M     max   deny 


  2. Run the following command:

    prctl -n process.max-sem-nsems $$
    Example 4. Output
    /export/home/fctech$ prctl -n process.max-sem-nsems $$
    
    process: 3636: -tcsh
    
    NAME    PRIVILEGE       VALUE    FLAG   ACTION       RECIPIENT
    
    process.max-sem-nsems
    
            privileged        512       -   deny                 -
    
            system          32.8K     max   deny  


When more than one FairCom server was run on a Unix system, the shared memory keys used by different servers could have the same value, which prevented connections to the servers. In addition, it was possible for unrelated applications to collide with default keys generated by FairCom DB servers.

To address this key collision, it is now possible for an administrator to specify specific shared memory keys for ISAM and SQL shared memory communication protocols ensuring the keys do not match existing keys already in use on the system.

New FairCom server configuration options are available to directly specify a shared memory key.

Example 5. SQL and ISAM each require separate shared memory support
SHMEM_KEY_ISAM <isam_shared_memory_key>

SHMEM_KEY_SQL <sql_shared_memory_key>


Example 6. Shared memory key values can be specified in either decimal or hexadecimal format
; Set shared memory key for ISAM connections to the specified decimal value:

SHMEM_KEY_ISAM 12345

; Set shared memory key for ISAM connections to the specified hexadecimal value:

SHMEM_KEY_ISAM 0xabcd


These server configuration options support specifying an environment variable, whose value is substituted for the configuration option value when the server starts up.

Example 7. If the environment variable MY_ISAM_KEY is set to a numeric value such as 12345 or 0xabcdef before starting the server process, then the following option can be specified in the server configuration file to use this environment variable value for the SHMEM_KEY_ISAM configuration option value.
SHMEM_KEY_ISAM %MY_ISAM_KEY% 


Compatibility notes

When these configuration options are not used, FairCom server uses the old method of assigning shared memory keys so its shared memory communication protocol is compatible with old clients. FairCom server now writes the shared memory key to the shared memory resource file and new clients know to read the shared memory key from this file. If a new client finds no shared memory key in the file, it uses the old method to assign a shared memory key so it is compatible with an old server.

The shared memory resource file is named /tmp/ctreedbs/<server_name> for ISAM, and /tmp/ctreedbs/CTSQL_<sql_port> for SQL, where /tmp/ctreedbs is the default shared memory directory. It can be changed using the SHMEM_DIRECTORY configuration option.

An old client will not be able to connect to a new server using shared memory if the server uses the SHMEM_KEY_ISAM or SHMEM_KEY_SQL configuration option to specify a shared memory key that differs from the shared memory key that the old method would generate.

On Unix systems, the FairCom server logs a message to CTSTATUS.FCS when it fails to create a system semaphore or shared memory segment due to a resource limit setting. This helps the server administrator understand the cause of the error.

Example 8. Example message
Fri Aug 22 15:14:44 2014

 - User# 00013  FSHAREMM: Failed to create system semaphore: check system semaphore limits such as SEMMNI

Fri Aug 22 15:14:44 2014

 - User# 00013  NewUser: Unable to create an instance of a named pipe


On Unix/Linux systems, a user can belong to more than one group of which one group is the primary group, and all other groups are secondary groups. When the SHMEM_PERMISSIONS option is used to only enable user and group permissions on shared memory resources, the resources created for shared memory connections (files, semaphores, shared memory regions) are assigned with the user's current primary group by default.

To address this situation, a new configuration option, SHMEM_GROUP, has been added preventing a user account that shares a secondary group with the user account under which the FairCom server process is running failing to connect using shared memory.

This option causes the FairCom server to assign group membership to the specified group. This option applies to the resources for both the ISAM and the SQL shared memory protocol.

Example 9. Group assignment example
As an example, consider two user accounts:
  • user1 - belongs to groups group1 and group2

  • user2 - belongs to group group2

If the user1 account runs the FairCom server with SHMEM_PERMISSIONS 660 in ctsrvr.cfg, a client program run by the user2 account will fail to connect using shared memory.

To allow the client program run by user2 to connect, add the following configuration option to ctsrvr.cfg and restart FairCom server:

SHMEM_GROUP group2

This causes the shared memory resources to be assigned to group group2, which allows the user2 client program to connect.



When clients used the shared memory protocol on Unix systems and the client and server processes were run under different user accounts, shared memory segments could be left behind after the connections were closed. The ipcs -m listing showed shared memory segments with no processes attached. In V10.3 and later, the logic has been modified to correct this.

Note

These changes add a field to the client and server logon data structures to pass the user ID between the client and server processes, resulting in the following compatibility considerations:
  • An old client can connect to a new server and it will behave as it did before these changes.

  • A new client cannot connect to an old server using shared memory. It will receive error 133 if the server is configured to only use shared memory. It will connect with TCP/IP if the server is using both shared memory and TCP/IP. The old server will log the following message to CTSTATUS.FCS:

    FSHAREMM: The client's shared memory version (2) is not compatible with the server's shared memory version (1)
    
  • At startup, the FairCom server now logs messages to CTSTATUS.FCS to indicate the shared memory directory used for logon purposes and the shared memory protocol version that it is using:

    FSHAREMM: SHMEM_DIRECTORY=/tmp/ctreedbs/
    FSHAREMM: Protocol version=2 

In release V11 and later, Unix and Linux FairCom DB servers use a Unix domain socket instead of named pipes for the initial shared memory protocol communication between the client and server (prior to this revision, all Unix and Linux systems except AIX used named pipes for the initial shared memory connection.)

The following

Shared memory protocol changes that were enacted:
  • Now FairCom server uses a Unix domain socket instead of a pair of named pipes for the initial communication when a client connects to the server. FairCom server still creates the named pipes, and when a client connects, the server waits for the client to write to either the socket or the named pipe. In this way, the server is able to support both clients that use the new method and those that use the original method.

  • The COMPATIBILITY SHMEM_PIPE configuration option has been deprecated and no longer has any effect.

  • FairCom DB clients (both ISAM and SQL) now use the Unix domain socket method when connecting using the shared memory protocol if the server indicates that it supports it. If not, the clients use the original method.

  • A FairCom DB client library can be compiled with #define NO_ctFeatUNIX_SHMEMsocket to force the client to use the original method only.

This section provides the hardware/software requirements and installation/configuration procedures for the Macintosh.

Operational environment

This version of the FairCom server is designed specifically to work on the Apple Mac OS X platform. Both the SQL and ISAM servers run as a FBA (faceless background application) launched via the terminal. Applications using this release communicate via the TCP/IP protocol. Mac client processes can execute on the same machine as the FairCom server for Mac.

The FairCom server for Mac contains the FairCom server executable, ctreeace or ctsrvr, and the utility and companion programs discussed throughout this guide.

Minimum hardware requirements for Macintosh

The minimum memory requirements are:
  • 4MB RAM for up to 8 users

  • 8MB for more than 8 users

  • Mac OS X 10.10 or later

Note

Legacy OS versions, PPC, and Universal Binary builds may be available upon request.

The minimum hard drive space required by the FairCom Server for Mac is 500 MB + the size of the data (.dat) and index (.idx) files.

FairCom DB v10 and earlier installation

To install the FairCom server for Mac on your platform, follow these steps:
  1. Make the desired directory (where the FairCom server is to be installed) the current directory.

  2. Copy the files in the /bin/ace/ (isam or sql) directory to your desired directory.

  3. Ensure you have an appropriate license authorization file for your platform and FairCom DB configuration.

    Note

    Your application vendor may provide applicable FairCom DB license files.

  4. For versions of FairCom server prior to V10.0, activate the FairCom server using the fcactvat program, after installation.

    See the FairCom server activation key card for instructions.

    Note

    Some FairCom server OEM vendors provide pre-activated FairCom server with their applications.

Configuring Mac systems

Because Mac OS X is based on a Unix kernel, please see FairCom DB Unix & Linux servers for Unix configuration settings, in addition to the Mac-specific details in this section.

Big-endian and little-endian compatibility

The FairCom server automatically allows big-endian and little-endian machines to share data across the same network. The FairCom term for this type of logic is Netformat.

Netformat logic automatically controls all aspects of data byte ordering (big-endian/little-endian). The server process defines the ordering of the data (High/Low as big-endian or Low/High as little-endian) while the client process dictates the alignment of the file.

Example 10. Netformat logic scenario
To further illustrate the power of the Netformat logic, review the following network scenario:
  • Server: c-tree IBM POWER 7 TCP/IP Server running AIX

  • Clients: Intel-based Windows word-aligned client application.

All data files will be stored in a High/Low (most significant byte, big-endian) format used by the IBM POWER 7 CPU. Files created by the Intel Windows application will be word-aligned (the default with Microsoft Visual Studio compiler). The applications will all be able to share the same files (assuming the application developer has aligned all numeric fields on at least a 2-byte boundary for this example — a good C programming practice).