Skip to content

Latest commit

 

History

History
181 lines (150 loc) · 7.11 KB

File metadata and controls

181 lines (150 loc) · 7.11 KB

Install Gravitee API Management with Docker Images Install

Before you begin

  • You must install Docker. For more information about installing Docker, go to Install Docker Engine.
  • If you are using the Enterprise Edition (EE) of Gravitee, ensure that you have a licensing key. If you do not know your licensing key, see the Gravitee Platform Pricing.

Installing Gravitee APIM

  1. Use the following command to create a directory structure in which to persist data and store plugins:

a. Create a directory structure using the following command:

{% code overflow="wrap" %}

mkdir -p /gravitee/{mongodb/data,elasticsearch/data,apim-gateway/plugins,apim-gateway/logs,apim-management-api/plugins,apim-management-api/logs,apim-management-ui/logs,apim-portal-ui/logs}

{% endcode %}

b. Once you create the directory, verify that the directory has the following structure:

{% code overflow="wrap" %}

/gravitee
 ├── apim-gateway
 │    ├── logs
 │    └── plugins
 ├── apim-management-api
 │    ├── logs
 │    └── plugins
 ├── apim-management-ui
 │    └── logs
 ├── apim-portal-ui
 │    └── logs
 ├── elasticsearch
 │    └── data
 └── mongodb
     └── data

{% endcode %}

  1. (Optional) If you are installing the Enterprise Edition (EE) of Gravitee APIM, copy your license key to /gravitee/license.key.

  2. Create two Docker bridge networks using the following commands:

    {% code overflow="wrap" %}

    $ docker network create storage
    $ docker network create frontend

    {% endcode %}

  3. Install MongoDB using the following commands:

    {% code overflow="wrap" %}

    $ docker pull mongo:6
    $ docker run --name gio_apim_mongodb \
      --net storage \
      --volume /gravitee/mongodb/data:/data/db \
      --detach mongo:6

    {% endcode %}

{% hint style="info" %} MongoDB is on the storagenetwork and uses /gravitee/mongodb for persistent storage. {% endhint %}

  1. Install Elasticsearch using the following commands:

{% code overflow="wrap" %}

$ docker pull docker.elastic.co/elasticsearch/elasticsearch:8.8.1
$ docker run --name gio_apim_elasticsearch \
  --net storage \
  --hostname elasticsearch \
  --env http.host=0.0.0.0 \
  --env transport.host=0.0.0.0 \
  --env xpack.security.enabled=false \
  --env xpack.monitoring.enabled=false \
  --env cluster.name=elasticsearch \
  --env bootstrap.memory_lock=true \
  --env discovery.type=single-node \
  --env "ES_JAVA_OPTS=-Xms512m -Xmx512m" \
  --volume /gravitee/elasticsearch/data:/var/lib/elasticsearch/data \
  --detach docker.elastic.co/elasticsearch/elasticsearch:8.8.1

{% endcode %}

{% hint style="info" %} Elasticsearch is on thestoragenetwork and uses /gravitee/elasticsearch for persistent storage. {% endhint %}

  1. Install the API Gateway using the following commands. If you use the Community Edition (CE) of Gravitee APIM, remove the following line: --volume /gravitee/license.key:/opt/graviteeio-gateway/license/license.key \.
$ docker pull graviteeio/apim-gateway:4.0
$ docker run --publish 8082:8082 \
  --volume /gravitee/apim-gateway/plugins:/opt/graviteeio-gateway/plugins-ext \
  --volume /gravitee/apim-gateway/logs:/opt/graviteeio-gateway/logs \
  --volume /gravitee/license.key:/opt/graviteeio-gateway/license/license.key \
  --env gravitee_management_mongodb_uri="mongodb://gio_apim_mongodb:27017/gravitee-apim?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000" \
  --env gravitee_ratelimit_mongodb_uri="mongodb://gio_apim_mongodb:27017/gravitee-apim?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000" \
  --env gravitee_reporters_elasticsearch_endpoints_0="http://elasticsearch:9200" \
  --env gravitee_plugins_path_0=/opt/graviteeio-gateway/plugins \
  --env gravitee_plugins_path_1=/opt/graviteeio-gateway/plugins-ext \
  --net storage \
  --name gio_apim_gateway \
  --detach graviteeio/apim-gateway:4.0
$ docker network connect frontend gio_apim_gateway

{% hint style="info" %} The API Gateway is on both the storage and frontend networks and uses /gravitee/apim-gateway for persistent storage. {% endhint %}

  1. Install the Management API using the following commands. If you are installing the CE of Gravitee, remove the following line: --volume /gravitee/license.key:/opt/graviteeio-management-api/license/license.key \
$ docker pull graviteeio/apim-management-api:4.0
$ docker run --publish 8083:8083 \
  --volume /gravitee/apim-management-api/plugins:/opt/graviteeio-management-api/plugins-ext \
  --volume /gravitee/apim-management-api/logs:/opt/graviteeio-management-api/logs \
  --volume /gravitee/license.key:/opt/graviteeio-management-api/license/license.key \
  --env gravitee_management_mongodb_uri="mongodb://gio_apim_mongodb:27017/gravitee-apim?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000" \
  --env gravitee_analytics_elasticsearch_endpoints_0="http://elasticsearch:9200" \
  --env gravitee_plugins_path_0=/opt/graviteeio-management-api/plugins \
  --env gravitee_plugins_path_1=/opt/graviteeio-management-api/plugins-ext \
  --net storage \
  --name gio_apim_management_api \
  --detach graviteeio/apim-management-api:4.0
$ docker network connect frontend gio_apim_management_api

{% hint style="info" %} The management API is on both the storage and frontendnetworks, and uses the /gravitee/apim-api for persistent storage. {% endhint %}

  1. Install the Console using the following commands:
$ docker pull graviteeio/apim-management-ui:4.0
$ docker run --publish 8084:8080 \
  --volume /gravitee/apim-management-ui/logs:/var/log/nginx \
  --net frontend \
  --name gio_apim_management_ui \
  --env MGMT_API_URL=http://localhost:8083/management/organizations/DEFAULT/environments/DEFAULT \
  --detach graviteeio/apim-management-ui:4.0

{% hint style="info" %} The Console is on the frontend network and uses /graviee/apim-management-ui for persistent storage. {% endhint %}

  1. Install the Developer using the following commands:
$ docker pull graviteeio/apim-portal-ui:4.0
$ docker run --publish 8085:8080 \
  --volume /gravitee/apim-portal-ui/logs:/var/log/nginx \
  --net frontend \
  --name gio_apim_portal_ui \
  --env PORTAL_API_URL=http://localhost:8083/portal/environments/DEFAULT \
  --detach graviteeio/apim-portal-ui:4.0

{% hint style="info" %} The Developer Portal is on the frontend network and uses /gravitee/apim-portal-ui for persistent storage. {% endhint %}

  1. To open the Console and the Developer portal, complete the following steps:
  • To open the console, go to http://localhost:8084.
  • To open the Developer Portal, go to http://localhost:8085.

{% hint style="info" %}

  • The default username for the Console and the Developer Portal is admin.
  • The default password for the Developer Portal is admin. {% endhint %}

{% hint style="success" %} Congratulations! Now that APIM is up and running, check out the Quickstart Guide for your next steps. {% endhint %}