美文网首页
携程Apollo部署

携程Apollo部署

作者: 于飞_d529 | 来源:发表于2019-11-05 15:21 被阅读0次

Apollo部署

版本

JDK 1.8.0_161
mysql 5.7
apollo 1.4.0

服务器

192.168.20.23 apollo-configservice apollo-configservice mysql
192.168.20.25 apollo-portal

安装目录

/usr/local/apollo/

应用对应端口

apollo-configservice 24000
apollo-adminservice  24001
apollo-portal        24000

apollo-configservice部署

  • 下载所需资源包
    https://github.com/ctripcorp/apollo/releases/tag/v1.4.0
    apollo-adminservice-1.4.0-github.zip
    apollo-configservice-1.4.0-github.zip
    apollo-portal-1.4.0-github.zip
    
  • 解压
    [root@cn2023 apollo]# unzip apollo-configservice-1.4.0-github.zip /usr/local/apollo/apollo-configservice/
    [root@cn2023 apollo]# unzip apollo-adminservice-1.4.0-github.zip -d /usr/local/apollo/apollo-adminservice/
    [root@cn2023 apollo-configservice]# ll
    total 60496
    -rwxr-xr-x. 1 root root 61898966 May  3 19:17 apollo-configservice-1.4.0.jar
    -rwxr-xr-x. 1 root root    39040 May  3 19:17 apollo-configservice-1.4.0-sources.jar
    -rw-r--r--. 1 root root       57 Apr 20  2017 apollo-configservice.conf
    drwxr-xr-x. 2 root root       63 Nov  1 13:35 config
    drwxr-xr-x. 2 root root       41 Apr 19  2019 scripts
    [root@cn2023 apollo-adminservice]# ll
    total 56936
    -rwxr-xr-x. 1 root root 58267291 May  3 19:17 apollo-adminservice-1.4.0.jar
    -rwxr-xr-x. 1 root root    26042 May  3 19:17 apollo-adminservice-1.4.0-sources.jar
    -rw-r--r--. 1 root root       57 Apr 20  2017 apollo-adminservice.conf
    drwxr-xr-x. 2 root root       63 Nov  1 13:36 config
    drwxr-xr-x. 2 root root       41 Apr 19  2019 scripts
    
  • 导入sql脚本
    mysql> source ~/apollo/V1.0.0__initialization.sql
    
  • 验证
    mysql> select `Id`, `Key`, `Value`, `Comment` from `ApolloConfigDB`.`ServerConfig` limit 1;
    +----+--------------------+-------------------------------+------------------------------------------------------+
    | Id | Key                | Value                         | Comment                                              |
    +----+--------------------+-------------------------------+------------------------------------------------------+
    |  1 | eureka.service.url | http://localhost:8080/eureka/ | Eureka服务Url,多个service以英文逗号分隔             |
    +----+--------------------+-------------------------------+------------------------------------------------------+
    1 row in set (0.00 sec)
    
  • 修改apollo-configservice数据库连接配置
    [root@cn2023 config]# cd /usr/local/apollo/apollo-configservice/config
    [root@cn2023 config]# vim application-github.properties
    # DataSource
    spring.datasource.url = jdbc:mysql://192.168.20.23:3306/ApolloConfigDB?characterEncoding=utf8
    spring.datasource.username = root
    spring.datasource.password = cmcc1234
    
  • 服务器双网卡的情况需要修改启动脚本防止不可达网卡被注册
    [root@cn2023 scripts]# vim startup.sh 
    -Deureka.instance.ip-address=192.168.20.23
    
  • 启动
    [root@cn2023 scripts]# ./startup.sh 
    Fri Nov  1 14:26:48 CST 2019 ==== Starting ==== 
    Started [32756]
    Waiting for server startup.......
    Fri Nov  1 14:27:24 CST 2019 Server started in 35 seconds!
    

apollo-adminservice部署

  • 修改apollo-adminservice数据库连接配置
    [root@cn2023 config]# cd /usr/local/apollo/apollo-adminservice/config/
    [root@cn2023 config]# vim application-github.properties
    # DataSource
    spring.datasource.url = jdbc:mysql://192.168.20.23:3306/ApolloConfigDB?characterEncoding=utf8
    spring.datasource.username = root
    spring.datasource.password = cmcc1234
    
  • 服务器双网卡的情况需要修改启动脚本防止不可达网卡被注册
    [root@cn2023 scripts]# vim startup.sh 
    -Deureka.instance.ip-address=192.168.20.23
    
  • 启动
    [root@cn2023 scripts]# ./startup.sh 
    Fri Nov  1 14:26:48 CST 2019 ==== Starting ==== 
    Started [32756]
    Waiting for server startup.......
    Fri Nov  1 14:27:24 CST 2019 Server started in 35 seconds!
    

apollo-portal部署

  • 导入apollo-portal的sql脚本
    mysql> source ~/apollo/V1.0.0__initialization_portal.sql
    
  • 验证
    mysql> select `Id`, `Key`, `Value`, `Comment` from `ApolloPortalDB`.`ServerConfig` limit 1;
    +----+--------------------+-------+--------------------------+
    | Id | Key                | Value | Comment                  |
    +----+--------------------+-------+--------------------------+
    |  1 | apollo.portal.envs | dev   | 可支持的环境列表         |
    +---+--------------------+-------+--------------------------+
    1 row in set (0.00 sec)
    
  • 修改apollo-portal数据库连接配置
    [root@cn2025 config]# vim application-github.properties
    # DataSource
    spring.datasource.url = jdbc:mysql://192.168.20.23:3306/ApolloPortalDB?characterEncoding=utf8
    spring.datasource.username = root
    spring.datasource.password = xxxx1234
    
  • 配置apollo-portal的meta service信息
    [root@cn2025 config]# vim apollo-env.properties 
    #local.meta=http://localhost:8080
    dev.meta=http://192.168.20.23:24000
    #fat.meta=http://fill-in-fat-meta-server:8080
    #uat.meta=http://fill-in-uat-meta-server:8080
    #lpt.meta=${lpt_meta}
    #pro.meta=http://fill-in-pro-meta-server:8080
    
  • 启动
    [root@cn2023 scripts]# ./startup.sh 
    Fri Nov  1 14:26:48 CST 2019 ==== Starting ==== 
    Started [32756]
    Waiting for server startup.......
    Fri Nov  1 14:27:24 CST 2019 Server started in 35 seconds!
    

相关文章

  • 携程Apollo部署

    Apollo部署 版本 服务器 安装目录 应用对应端口 apollo-configservice部署 下载所需资源...

  • 携程 Apollo 配置中心分布式部署(Docker)

    在Spring Boot 2.0 整合携程Apollo配置中心一文中,我们在本地快速部署试用了Apollo。本文将...

  • Apollo搭建过程

    Apollo 简介 Apollo[https://github.com/apolloconfig](阿波罗)是携程...

  • Apollo配置中心 原理分析

    关键字 :Apollo原理、Apollo动态刷新机制 什么是Apollo? Apollo(阿波罗)是携程框架部门研...

  • Spring cloud config

    配置中心有哪些?spring cloud config、 apollo(携程)、 nacos(阿里巴巴)、zook...

  • 配置中心

    Apollo简介 Apllo为携程开发的框架,用作配置中心,本系统基于apollo-1.4.0版本 所需环境 jd...

  • 配置中心-Apollo(携程)

    核心: Http Long Polling 基于KV

  • Apollo配置中心在项目中应用

    Apollo Apollo(Github主页)是携程框架部门研发的配置管理平台,能够集中化管理应用不同环境、不同集...

  • springboot集成apollo

    一、简介 1.Apollo 是什么?Apollo(阿波罗)是携程框架部门研发的分布式配置中心。服务端基于Sprin...

  • Apollo的学习

    关于apollo Apollo(阿波罗)是携程框架部门研发的分布式配置中心,能够集中化管理应用不同环境、不同集群的...

网友评论

      本文标题:携程Apollo部署

      本文链接:https://www.haomeiwen.com/subject/tqtebctx.html