Installing Statistics Collection service
Installing the Statistics Collection service is optional if you do not plan to collect and analyze usage statistics for API keys used with the API Platform services.
Important note:
All passwords and keys in this section are given for illustration purposes.
During a real installation, it is recommended to use more complex and reliable passwords.
1. Before installing
-
Consider getting familiar with:
-
Make sure the necessary preparation steps are completed:
-
Collect the necessary information that was set or retrieved on previous steps:
Object Example value How to get value Docker Registry mirror endpoint docker.storage.example.local:5000See Fetching installation artifacts Kubernetes secret for accessing Docker Registry onpremise-registry-credsSee Fetching installation artifacts -
Make sure that the resource requirements specified in the Helm chart are met.
For more information on how to do this, refer to the System requirements document.
Note
Contents of the Helm chart described in this chapter are relevant for the latest API Platform version (see API Platform releases). To find parameters for earlier versions, open the values.yaml on GitHub and select a
Platform-<version>tag in the tag switcher on the left. -
Choose a domain name for the statistics collection service. For example:
stat-receiver.example.com.
2. Install the Statistics Collection service
-
Create a Helm configuration file. See here for more details on the available settings.
The example is prefilled with the necessary data collected on previous steps.
values-stat-receiver.yamldgctlDockerRegistry: docker.storage.example.local:5000
kafka:
servers: 'keys-kafka.storage.example.local:9092'
truststore:
enabled: false
keystore:
enabled: false
sasl:
enabled: true
secretName: 'stat-receiver-kafka-creds'
jaasLoginModule: 'org.apache.kafka.common.security.scram.ScramLoginModule'
username: ''
password: ''
initializeTopics:
enabled: true
topicsPrefix: 'stat_master_'Where:
-
dgctlDockerRegistry: endpoint of your Docker Registry with the images of the On-Premise services. -
kafka: Apache Kafka access settings.-
servers: address and port of the Apache Kafka cluster that was configured during the Installation of the API Keys service. -
truststore.enabled: enable to use TLS for connecting to Kafka. -
keystore.enabled: enable to use client authentication TLS for connecting to Kafka. -
sasl: settings for SASL connection to Kafka.enabled: enable if SASL authentication is also enabled in the API Keys service.secretName: Kubernetes secret name, where the credentials for connecting to Kafka are stored. The name must be unique within the cluster namespace used for installation.jaasLoginModule: JAAS configuration string for SASL connection.username: username for connecting to Kafka. Required if thesecretNamefield is empty.password: password for connecting to Kafka. Required if thesecretNamefield is empty.
-
-
initializeTopics.enabled: enable to have the statistics collection service create the necessary topics in Kafka on first startup. -
topicsPrefix: prefix for the names of the topics that will be created in Kafka. See the name of the topic you specified in thekafka.stats.topicparameter in the API Keys service configuration file: the prefix is the initial part of the topic name up totype.401(fixed part of the name).
-
-
Deploy the service with Helm using the created
values-stat-receiver.yamlconfiguration file:helm upgrade --install --version=VERSION --atomic --wait --timeout 7200s --values ./values-stat-receiver.yaml stat-receiver 2gis-on-premise/stat-receiverIn the
--versionparameter, specify the required API Platform version. For a list of versions, see the API Platform releases section.
3. Test deployment
When you install all the necessary API Platform services, you will be able to view their usage statistics and configure limits in the web interface of the API Keys service.
What's next?
-
Find out how to update the Statistics Collection service.
-
Install other On-Premise products:
-
Learn recommendations on maintaining the installation.