cool hit counter Apollo Distributed Configuration Center Deployment and Usage_Intefrankly

Apollo Distributed Configuration Center Deployment and Usage

I. Introduction

apollo(Apollo (loanword)) It is a distributed framework developed by the Ctrip framework department configure centre, Ability to centralize the management of applications across different environments、 Different clusters of configure, configure Ability to push to the app in real time after modification, And with regulated authority、 Features such as process governance, Applicable to microservices configure Management scenarios。

official (relating a government office)github:

Author's introduction to Apollo pairs:

II. Installation and deployment


The environment for this deployment isDEV( development environment (computer))、FAT( test (machinery etc) environments)、UAT( pre-production)、PRO( productive)

Application server.

Database server.


Download code.

A few of the more important items.

apollo-configservice: provide configure Obtaining the interface, provide configure Update the push interface, The interface serves theApollo client side

apollo-adminservice: provide configure management interface, provide configure modify、 Interface for publishing, etc., The interface serves thePortal, andEureka

apollo-portal: provides a web interface for users to manage configuration

apollo-client: client application provided by Apollo, providing configuration fetching, real-time updates, etc. for the application

The figure above briefly depicts the configure The general process of publishing:

Users inPortal operations configure issue

Portal calls Admin Service's interface to operate publishing

After Admin Service releases the configuration, it sends ReleaseMessage to each Config Service

When the Config Service receives the ReleaseMessage, it notifies the corresponding client

Database initialization.

The following sql is in uppercase format, note the case-sensitive setting of the database

ApolloPortalDB: Implementation

ApolloConfigDB: DEV FAT UAT PRO Environment Execution

adapt configure packaged with:

(located) at Find the table of contents in the project of configure documents perhaps

Database configuration

modify Database configuration, The one above is configure, Here's the one below configure:

apollo config db info This database configuration only needs to be configured once, no changes are needed for different environments

apollo portal db info The database is based on different environments configure Corresponding database connections, And it takes multiple hits

Modify the environment call address

Modify database data

(located) atDEV FAT UAT PRO corresponding databases, find the table hit the target configure item:

Modifying the environment configure, (located) at Database modification table hit the target :

For specific configurations, you can check the official website:

Compilation, packaging

The script will pack , , and in turn .

Since they are deployed in each environment, different packages are required for different environments with different database connection information, and only one package is required for

Start of deployment

Deploy the program to the corresponding server

Deploying apollo-configservice

Upload the directory to the server and unzip the


Just do it!

If you need to stop the service, execute

Deploying apollo-adminservice

Upload the directory to the server and unzip the


Just do it!

If you need to stop the service, execute

Deploying apollo-portal

Upload the directory to the server and unzip the


Just do it!

If you need to stop the service, execute

Access testing

Above deployment complete, may test (machinery etc)

Visit the different environments of , to see if the services are registered correctly.

If you can see..:

UP for both services, normal!

Access client.

Log in, default username password is.

New construction project testing.

three、 use configure centre configure information

maven brings in the successfully compiled and packaged packages from the above steps.


Please ensure that the classpath:/META-INF/ file exists and that its contents are your own project name, and that it remains unique:.

Environment variables configure

Local Development

For local development, you can add Environment to the development tools at

online environment configure way:

Using the Java startup parameters to add

Through the System Environment of the operating system

pass (a bill or inspection) configure documents:

For Mac/Linux, the file location is /opt/settings/

For Windows, the file location is

Reference in the project harmony packet, (located) at The package can be seen in configure documents, default configure For pre-packaging configure information on:

If you need to modify or overwrite it, copy a file from the top of the project and modify the corresponding environment information.

commission configure

Adding an annotation to the startup class is sufficient.

test (machinery etc)

Add a test class , and of course the configuration center should have the configuration information configured below:


IV. Deployment options

This figure is the planned deployment scenario, not the one in the example written above

1、The river bank district big data and cloud computing service application subsidies to start filing
2、Big Data Hadoop Hive and Spark Intrinsically Connected
3、Sun Shan The Dilemma and Way Out of Copyright Law Protection for Artificial Intelligence Generated Content
4、Honor Magic 2 gets confirmed
5、MC Factory Manager finale on the horizon Adventurer AO in My World

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送