Get the App
SLTechnology News&Howtos  ›  Servers  › 

Summary of multi-environment deployment for installing ctrip-apollo

Shulou Source: shulou.com Published: 2022-06-03 04:32:41 09月22日 Update

1. Download (https://github.com/ctripcorp/apollo/releases) apollo three compressed files

2. Install mysql5.7 on this machine

The installation steps are briefly described.

3. Create a database

Development environment (dev): apolloconfigdb

Test call (fat): apolloconfigdb2

Portal:apolloportaldb

Note: a portal manages multiple environments, and only one portal program and one portal library need to be deployed. Config and admin, each environment needs a matching set.

4. Modified configuration file

4.1 portal configuration

Cd / data/apollo-portal/config

Vim apollo-env.properties

Save

Vim application-github.properties

Save

4.2 config configuration

The first config

Cd / data/apollo-configservice/config/

Vim application-github.properties

Second config

Cd / data/apollo-configservice/config/

Vim application-github.properties

4.3 admin configuration

The first admin

Cd / data/apollo-adminservice/config

Vim application-github.properties

Second admin

Cd / data/apollo-adminservice/config

Vim application-github.properties

5. Modify the following fields in the serverconfig table of the apolloportaldb library

Note: it needs to match the environment in apollo-env.properties.

6. Default access address port

8080:config, meta, eureka (with pages)

8070:portal (with pages)

8090:admin

7. Config, meta, eureka are in a jvm

8. Client use

8.1 spring boot project starts, add @ EnableApolloConfig to the startup class, such as: br/ > @ EnableApolloConfig, such as:

8.2 add dependency packages to pom files

8.3 other configurations are as follows

App.properties content:

App.id=yuhang

Apollo-env.properties content:

Dev.meta= http://192.168.41.100:8080

# fat.meta= http://apollo.fat.xxx.com

# uat.meta= http://apollo.uat.xxx.com

# pro.meta= http://apollo.xxx.com

Application.properties content:

# configuration example of injecting default application namespace

Apollo.bootstrap.enabled = true

# load the Apollo configuration before initializing the logging system

Apollo.bootstrap.eagerLoad.enabled=true

# namespace to be used

Apollo.bootstrap.namespaces = application

9. See synonyms at other uses

Https://github.com/ctripcorp/apollo/wiki

10. Environment

Two linux virtual machines: 192.168.41.100 and 192.168.41.101

Jdk:jdk1.8

Deployment path

Portal:/data/apollo-portal

Admin:/data/apollo-adminservice

Config:/data/apollo-configservice

Native: install mysql5.7

Tags: Configuration environment content files pages native three addresses multiple fields customers clients data databases logs steps examples programs ports system Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Docker Shulou Technology NVidia Shulou Information