79 lines
2.7 KiB
Markdown
79 lines
2.7 KiB
Markdown
|
|
# OpenBMP Collector Container Image
|
||
|
|
Collector is the container for collecting BMP messages from BMP senders, e.g. routers.
|
||
|
|
|
||
|
|
## Container Includes
|
||
|
|
* The Latest collector (listening port is TCP 5000)
|
||
|
|
|
||
|
|
## Building the container
|
||
|
|
See [Dockerfile] notes.
|
||
|
|
|
||
|
|
## Steps to Use the container
|
||
|
|
|
||
|
|
### 1) Install docker
|
||
|
|
Follow the [Docker Instructions](https://docs.docker.com/installation/) to install docker.
|
||
|
|
|
||
|
|
### 2) Download the docker image
|
||
|
|
|
||
|
|
docker pull openbmp/collector
|
||
|
|
|
||
|
|
### 3) [OPTIONAL] Add persistent configs
|
||
|
|
|
||
|
|
mkdir -p /var/openbmp/config
|
||
|
|
chmod 777 /var/openbmp/config
|
||
|
|
|
||
|
|
#### config/hosts
|
||
|
|
You can add custom host entries so that the collector will reverse lookup IP addresses
|
||
|
|
using a persistent hosts file.
|
||
|
|
|
||
|
|
Run docker with ```-v /var/openbmp/config:/config``` to make use of the persistent config files.
|
||
|
|
|
||
|
|
#### config/openbmpd.conf
|
||
|
|
You can provide a customized **openbmpd.conf**. See [Config Example](https://github.com/OpenBMP/obmp-collector/blob/main/Server/openbmpd.conf)
|
||
|
|
|
||
|
|
### 4) Run docker container
|
||
|
|
|
||
|
|
#### Environment Variables
|
||
|
|
Below table lists the environment variables that can be used with ``docker run -e <name=value>``
|
||
|
|
|
||
|
|
NAME | Value | Details
|
||
|
|
:---- | ----- |: -------
|
||
|
|
KAFKA\_FQDN | hostanme or IP | Kafka broker hostname[:port]. Hostname can be an IP address
|
||
|
|
OPENBMP\_ADMIN\_ID | name or IP | Name or IP of the collector, default is the docker hostname
|
||
|
|
OPENBMP\_BUFFER | Size in MB | Defines the openbmpd buffer per router for BMP messages. Default is 16 MB.
|
||
|
|
|
||
|
|
#### Run normally
|
||
|
|
|
||
|
|
> ##### IMPORTANT
|
||
|
|
> You must define the **KAFKA_FQDN** as a 'hostname'. If all containers are running on the same node, this
|
||
|
|
> hostname can be local specific, such as 'localhost' or 'myhost'. If Kafka is running on a different server,
|
||
|
|
> than the consumers and producers, then the KAFKA_FQDN should be a valid hostname that can be resolved using DNS.
|
||
|
|
> This can be internal DNS or manually done by updating the /etc/hosts file on each machine.
|
||
|
|
|
||
|
|
docker run -d --name=obmp_collector -e KAFKA_FQDN=localhost \
|
||
|
|
--sysctl net.ipv4.tcp_keepalive_intvl=30 \
|
||
|
|
--sysctl net.ipv4.tcp_keepalive_probes=5 \
|
||
|
|
--sysctl net.ipv4.tcp_keepalive_time=180 \
|
||
|
|
-v /var/openbmp/config:/config \
|
||
|
|
-p 5000:5000 \
|
||
|
|
openbmp/collector
|
||
|
|
|
||
|
|
|
||
|
|
### Monitoring/Troubleshooting
|
||
|
|
|
||
|
|
You can use standard docker exec commands to monitor the log files. To monitor
|
||
|
|
openbmp, use ```docker exec obmp_collector tail -f /var/log/openbmpd.log```
|
||
|
|
|
||
|
|
Alternatively, it can be easier at times to navigate all the log files from within the container. You can do so using:
|
||
|
|
|
||
|
|
docker exec -it obmp_collector bash
|
||
|
|
|
||
|
|
|
||
|
|
#### docker logs
|
||
|
|
You can use ```docker logs obmp_collector``` to get the console logs. This is useful if the container exits due to
|
||
|
|
invalid start or for another reason.
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|