容器部署

容器部署 #

INFINI Console 支持容器方式部署。

下载镜像 #

INFINI Console 的镜像发布在 Docker 的官方仓库,地址如下:

https://hub.docker.com/r/infinilabs/console

使用下面的命令即可获取最新的容器镜像:

docker pull infinilabs/console:latest

验证镜像 #

将镜像下载到本地之后,可以看到 INFINI Console 平台的容器镜像非常小,只有不到 30MB,所以下载的速度应该是非常快的。

✗ docker images              
REPOSITORY                                      TAG       IMAGE ID       CREATED          SIZE
infinilabs/console                            latest    8c27cd334e4c   47 minutes ago   26.4MB

创建配置 #

现在需要创建一个配置文件 console.yml,来进行基本的配置,如下:

# for this System Cluster, please use Elasticsearch  v7.3+
elasticsearch:
  - name: default
    enabled: true
    monitored: false
    endpoint: http://192.168.3.188:9299
    basic_auth:
      username: elastic
      password: ZBdkVQUUdF1Sir4X4BGB
    discovery:
      enabled: true

web:
  enabled: true
  embedding_api: true
  auth:
    enabled: true
  ui:
    enabled: true
    path: .public
    vfs: true
    local: true
  network:
    binding: 0.0.0.0:9000
    skip_occupied_port: true
  gzip:
    enabled: true

elastic:
    elasticsearch: default
    enabled: true
    remote_configs: true
    health_check:
      enabled: true
      interval: 30s
    availability_check:
      enabled: true
      interval: 60s
    metadata_refresh:
      enabled: true
      interval: 30s
    cluster_settings_check:
      enabled: true
      interval: 20s
    store:
      enabled: false
    orm:
      enabled: true
      init_template: true
      template_name: ".infini"
      index_prefix: ".infini_"

metrics:
  enabled: true
  major_ip_pattern: "192.*"
  queue: metrics
  elasticsearch:
    enabled: true
    cluster_stats: true
    node_stats: true
    index_stats: true

pipeline:
  - name: indexing_merge
    auto_start: true
    keep_running: true
    processor:
      - indexing_merge:
          input_queue: "metrics"
          elasticsearch: "default"
          index_name: ".infini_metrics"
          output_queue:
            name: "metrics_requests"
            label:
              tag: "metrics"
          worker_size: 1
          bulk_size_in_mb: 10
  - name: consume-metrics_requests
    auto_start: true
    keep_running: true
    processor:
      - bulk_indexing:
          bulk:
            compress: true
            batch_size_in_mb: 10
            batch_size_in_docs: 5000
          consumer:
            fetch_max_messages: 100
          queues:
            type: indexing_merge
          when:
            cluster_available: [ "default" ]
  - name: metadata_ingest
    auto_start: true
    keep_running: true
    processor:
      - metadata:
          bulk_size_in_mb: 10
          bulk_max_docs_count: 5000
          fetch_max_messages: 1000
          elasticsearch: "default"
          queues:
            type: metadata
            category: elasticsearch
          consumer:
            group: metadata
          when:
            cluster_available: [ "default" ]
  - name: activity_ingest
    auto_start: true
    keep_running: true
    processor:
      - activity:
          bulk_size_in_mb: 10
          bulk_max_docs_count: 5000
          fetch_max_messages: 1000
          elasticsearch: "default"
          queues:
            category: elasticsearch
            activity: true
          consumer:
            group: activity
          when:
            cluster_available: [ "default" ]

Note: 上面配置里面的 Elasticsearch 的相关配置,请改成实际的服务器连接地址和认证信息,需要版本 v7.3 及以上。

启动平台 #

使用如下命令启动极限网关容器:

docker run -p 9000:9000  -v=`pwd`/console.yml:/console.yml  infinilabs/console:latest

Docker Compose #

还可以使用 docker compose 来管理容器实例,新建一个 docker-compose.yml 文件如下:

version: "3.5"

services:
  infini-console:
    image: infinilabs/console:latest
    ports:
      - 9000:9000
    container_name: "infini-console"
    volumes:
      - ../console.yml:/console.yml

volumes:
  dist:

在配置文件所在目录,执行如下命令即可启动,如下:

➜  docker-compose up