4.2.3. On Linux
4.2.3.1. General information
The installer sets up server processes so that they are started in daemon mode, that is, without binding them to any specific control terminal. If necessary, the server agent can be started with command-line switches.
NOTE. When 1C:Enterprise server runs in daemon mode, debugging over HTTP is not supported.
If you need to configure systems so that the server cluster starts immediately at system startup, then configure the systemd service management subsystem of the Linux operating system accordingly. To operate with systemd, use the systemctl utility. The files that you use to configure systemd are called units or service files.
systemctl requires superuser (root) rights. In the examples, this point is ignored (to shorten the example). So, you will either need to run the console as superuser or precede each systemctl command with a sudo command. For example: sudo systemctl list (gets a list of running services).
4.2.3.2. Run as an application
To start the server agent, use the following command-line switches:
./ragent /daemon /port <port> /regport <port> /range <ranges> /seclev <level> /d <directory> /pingPeriod <time> /pingTimeout <time> /debug -<mode> /debugServerAddr <address> /debugServerPort <port> /debugServerPwd <password>
IMPORTANT! The name and value of the parameter must be space-separated.
/daemon
This switch allows you to start the server agent in daemon mode, that is, as a background application that does not interact with the terminal used to start it. Running the server agent with this switch does not auto start the server agent after a system reboot.
/port <port>
Network port number of the server agent (ragent). This port is used by the cluster console to access the main server. The cluster agent port is also specified as the network port of the working server. Default value: 1540.
/regport <port>
Network port number of the main cluster manager (rmngr) created by default at first ragent startup. Default value: 1541.
/range <range>
Network port ranges for dynamic selection. Used as the initial value of the IP port ranges property of the working cluster server created by default at first ragent startup. Default value: 1560:1591. Examples of range values: 4549:4567, 7072:7790.
/seclevel <level>
Optional. Security level of the cluster agent process. Specifies the security level of connections established with the ragent process. Level can take values:
- 0 (default): unsecure connections
- 1: secure connections only for the duration of user authentication
- 2: permanently secure connections
For details on connection security level, see article Security of data exchanged between a client and a server cluster
/d <directory>
Directory that contains (or will contain) server cluster service files (including the list of clusters and the list of cluster infobases). If the parameter is not specified, the default directory is used: ~/.1cv8. If the directory path contains spaces, the path must be enclosed in quotes, for example:
/d "~/cluster data"
/pingPeriod <time>
Connection interruption check frequency, in milliseconds (see article Connection break monitoring).
Default value: 1,000.
/pingTimeout <time>
Check timeout of the connection break monitoring system, in milliseconds (see article Connection break monitoring).
Default value: 5,000.
The values specified for the /pingPeriod and /pingTimeout commands are used for all outgoing connections of cluster processes on this server that have been started via this server agent process.
If the cluster contains several working servers and changing the default period and timeout values is advisable, we recommend that you:
- Set the check timeout value to be 3-10 times longer than the check period.
- Do not set the check period value to be less than 1,000 milliseconds.
- Specify the same check period and timeout values on all servers in one cluster.
/debug -<mode>
Running a server cluster in configuration debug mode. The <mode> parameter specifies the protocol the debugger will use on this server cluster:
- -tcp: TCP/IP protocol.
- -http: HTTP protocol.
Default value: -tcp.
TIP. Since server performance drops in debug mode, it is recommended that you apply the mode only for those servers where debugging is required.
/debugServerAddr <address>
Specifies the address of the computer where the debug server is running. It is recommended that you use this switch when several network cards are installed on the computer.
If the switch is not specified, an arbitrary network address that belongs to the computer running the debug server will be used.
/debugServerPort <port>
Specifies the port to be used by the debug server. Default port: 1550.
/debugServerPwd <password>
Specifies the password to be used by the client application when establishing a connection with the debug server of this server cluster.
By default, no password is set.
To stop the server agent running as an application, press Ctrl + C.
4.2.3.3. Run as a service
NOTE. Setup operations require (root) superuser rights.
To use 1C:Enterprise server as a service and automatically start it at operating system startup, register the server cluster unit in systemd:
- For Linux (except for CentOS 7), run the following command:
systemctl link /opt/1cv8/arch/A.B.C.D/srv1cv8-A.B.C.D@.service
To register, specify the full path to the systemd unit.
- For CentOS 7:
- Create a hard link or a copy of the srv1cv8-A.B.C.D@.service file named srv1cv8-A.B.C.D@default.service:
ln /opt/1cv8/arch/A.B.C.D/srv1cv8-A.B.C.D@{,default}.service
- Register the unit:
systemctl link /opt/1cv8/arch/A.B.C.D/srv1cv8-A.B.C.D@default.service
In the command examples above, replace the word arch with the bitness of the used 1C:Enterprise version:
- 32-bit version: i386.
- 64-bit version: x86_64.
Use the unit available in the 1C:Enterprise distribution package to register an instance of the server cluster service named default. If you need to organize simultaneous operation of several server cluster instances on one computer, you need:
- Different instances of the same version. For more information, see article Running multiple servers with identical 1C:Enterprise versions.
- Different instances of different versions. For more information, see article Running multiple servers with different 1C:Enterprise versions.
After you complete the previous steps, the start of a server cluster of a specific version and bitness will be added to the list of automatically started services.
After registration is completed, you can manage the automatic service start at operating system startup:
Action | Command |
Enable automatic start | systemctl enable srv1cv8-A.B.C.D |
Disable automatic start | systemctl disable srv1cv8-A.B.C.D |
To manage the automatic service start, use the service name: srv1cv8-A.B.C.D
You can also manage a specific server cluster instance:
Action | Command |
Start | systemctl start srv1cv8-A.B.C.D@instName |
Stop | systemctl stop srv1cv8-A.B.C.D@instName |
Get status | systemctl status srv1cv8-A.B.C.D@instName |
To manage a specific server cluster instance, this instance name is srv1cv8-A.B.C.D@instName, where instName is a name of the specific instance. An instance that is registered with default parameters has the following service name defined: default.
4.2.3.4. Editing server cluster instance parameters
To edit any server cluster instance parameters, use the following command:
systemctl edit srv1cv8-A.B.C.D@instanceName
Then, in the opened file, create the [Service] section (if it is not set yet) and specify the parameters to be changed in it in the following notation: Environment=SRV1CV8_REGPORT=1541. In this example:
- Environment. A required value. Defined by systemd unit declaration syntax.
- SRV1CV8_REGPORT. A server cluster parameter name. The parameter list is given in the table below.
- 1541. A parameter value. Depends on the parameter name.
The table lists parameters available for editing:
Parameter | Description |
SRV1CV8_DATA | Full path to the directory containing the server cluster service files (including the cluster list and the cluster infobase list). Default value:/home/usr1cv8/.1cv8/1C/1cv8. |
SRV1CV8_DEBUG | Indicates that the server cluster is started in debug mode. Can be empty (nothing is specified, an empty string) or -debug. Default value: empty value. |
SRV1CV8_KEYTAB | Path to the keytab file that will be used by 1C:Enterprise server cluster to authenticate the operating system. Default value:/opt/1cv8/x86_64/A.B.C.D/usr1cv8.keytab. |
SRV1CV8_PINGPERIOD | Check period of the connection break monitoring system (in milliseconds). For more information, see article Connection break monitoring. Default value: 1 000. |
SRV1CV8_PINGTIMEOUT | Check timeout of the connection break monitoring system (in milliseconds). For more information, see article Connection break monitoring. Default value: 5 000. |
SRV1CV8_PORT | Network port number of the server agent (ragent). For more information, see article Client application and server cluster interaction. Default value: 1540. |
SRV1CV8_RANGE | Network port ranges for dynamic selection. For more information, see article Client application and server cluster interaction. Default value: 1561-1590. |
SRV1CV8_REGPORT | Network port number of the main cluster manager (rmngr). For more information, see article Client application and server cluster interaction. Default value: 1561. |
SRV1CV8_SECLEV | Connection security level. For more information, see article Security of data exchanged between a client and a server cluster. The parameter can take the following values:
|