Backend server setup and launch¶
Backend server setup¶
After installation, backend server configuration files are in /usr/local/FlashphonerWebCallServerOAM/conf
folder:
Where
log4j2.properties
- backend server logging configurationwcsoam-core.properties
- backend server JVM configurationwcsoam.properties
- backend server main configuration fileWCS-OAM.version
- backend server versionwss.jks
- SSL certificate storage
To apply any configuration changes, backend server must be restarted.
Metrics storage DB connection setup¶
Influx BD connection setup¶
The following parameter in wcsoam.properties file should be set to allow to store metrics to Influx DB
DB URL should be set for connection setup. By default, if Influx DB is on the same server, URL should be set as
DB name and access parameters should also be set
By default, WCS OAM connects to Influx DB via UDP:
In this case, metric values can be lost. To escape loss, metric values can be passed using HTTP POST
query as follows
POST /write?u=root&p=root&db=wcs_oam&rp=default&precision=n&consistency=one HTTP/1.1
3-5062030c-9def-49c2-a89e-639d664ab806 AUDIO_CODEC=102i,AUDIO_LOST=3795015i,AUDIO_RATE=137776i,AUDIO_SYNC=123432141899i,seq=26558i 1562263828767000000
Metrics writing can be switched to HTTP with the following parameter
Anyway, metric values are read from Influx DB using HTTP GET
query as follows
GET /query?u=root&p=root&db=wcs_oam&q=SELECT+*+FROM+%221-89dc5510-a198-11e9-a049-030fe6b5675c%22+order+by+time+desc+limit+10+offset+0 HTTP/1.1
Timescale DB connection setup¶
The following parameter in wcsoam.properties
file should be set to allow to store metrics to Timescale DB
DB URL and access parameters should be set for connection setup
timescale.url=jdbc:postgresql://127.0.0.1:5432/wcsstat
timescale.username=wcsoam
timescale.password=wcsoam
Connection tuning¶
Metric values batch size to write to DB can be set with the following parameter
In this case metrics will be written to DB in batches of 1000 values.
Stream history and data acquisition settings DB connection setup¶
History storage support is enabled with the following parameter
Using H2¶
H2 embedded database is allowed for debug and testing purposes only, not for production usage
If H2 connection is necessary, add to wcsoam.properties
file the following:
spring.h2.console.enabled=true
spring.datasource.url=jdbc:h2:./wcs_oam
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.jpa.show-sql=false
spring.jpa.hibernate.ddl-auto=update
Using Postgresql¶
To connect to Postgresql, add to wcsoam.properties
file the following
spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/wcsoam
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.username=wcsoam
spring.datasource.password=wcsoam
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.show-sql=false
spring.jpa.hibernate.ddl-auto=create
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
Where
wcsoam
- database name, user name and password which are set for Posgresql
SQL DB connection tuning¶
Under high load, it may be necessary to change DB records queue size. It may be done with the following parameter
By default, queue size is 3000 records.
SQL queries logging¶
If necessary, SQL queries logging can be enabled for debug purposes using the following parameters in wcsoam.properties
file
Note that metrics store to TimescaleDB will also be logged in this case.
WCS interaction setup¶
By default, backend server listens to WCS server connections for metrics acquisition on TCP port 7777. This port can be changed with the following parameter
Connection authentication key should be set with the following parameter
By default, authentication key is set to 123.
Also, backend server connects to WCS server to get published stream data using REST API. WCS port to connect is set with the following parameter
Client connection setup¶
SSL configuration¶
Backend server allows client connections using HTTPS and Secure Websocket. SSL is configured with the following parameters
server.ssl.key-store-type=JKS
server.ssl.key-store=file:/usr/local/FlashphonerWebCallServerOAM/conf/wss.jks
server.ssl.key-store-password=password
server.ssl.key-alias=selfsigned
Where
server.ssl.key-store-type
- SSL certificate storage type; only JKS is supportedserver.ssl.key-store
- SSL certificate storage locationserver.ssl.key-store-password
- SSL certificate storage passwordserver.ssl.key-alias
- domain name
By default, backend server is shipped with self-signed certificate. SSL certificate can be imported to backend server SSL storage using keytool in the same way as for WCS server. If wildcard certificate is used, and backend server is in the same domain with WCS server, WCS SSL storage file can be copied to backend server configuration folder, for example
Port configuration¶
HTTPS port to handle REST queries, WSS connections and for web interface access is set with the following parameter
Backend server starting¶
Backend server can be started from /usr/local/FlashphonerWebCallServerOAM/bin
folder
or, if it was installed as system service
Backend server stopping¶
Backend server can be stopped from /usr/local/FlashphonerWebCallServerOAM/bin
folder
or, if it was installed as system service