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:https://github.com/ctripcorp/apollo

Author's introduction to Apollo pairs: https://github.com/ctripcorp/apollo/wiki/Apollo%E9%85%8D%E7%BD%AE%E4%B8%AD%E5%BF%83%E4%BB%8B%E7%BB%8D

II. Installation and deployment

infrastructure

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

Application server.

Database server.

configure

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: https://github.com/ctripcorp/apollo/wiki/%E5%88%86%E5%B8%83%E5%BC%8F%E9%83%A8%E7%BD%B2%E6%8C%87%E5%8D%97

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

Modification:

Just do it!

If you need to stop the service, execute

Deploying apollo-adminservice

Upload the directory to the server and unzip the

Modification:

Just do it!

If you need to stop the service, execute

Deploying apollo-portal

Upload the directory to the server and unzip the

Modification:

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.

Create app.properties

Please ensure that the classpath:/META-INF/app.properties 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/server.properties

For Windows, the file location is C:optsettingsserver.properties

configureapollo-env.properties

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:

Done!

IV. Deployment options

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


Recommended>>
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字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号