扫一扫下方二维码,关注本站官方公众号
获取永久解锁本站全部文章的验证码
还能不定期领现金红包

微服务配置中心---Apollo配置中心快速启动配置-Go语言中文社区

微服务配置中心---Apollo配置中心快速启动配置



打开命令行窗口,再Jar文件下,依次运行下面命令
第一步:运行sql文件夹下的sql脚本,会生成两个数据库 apolloconfigdb 和 apolloportaldb 数据库
第二步:打开cmd窗口进入jar文件夹,运行1和2的命令,运行完毕之后,再浏览器访问 localhost:8080
出现下图时

在这里插入图片描述

第三步:运行3命令,访问localhost:8070 即可看到Apollo的登录界面

初始账号密码:apollo admin

以下命令中:username为数据库用户名 password为数据库密码 url 为数据库连接字符串 
—Ddev_meat=http://localhost:8080/ apollo-configservice 的运行地址  如果不在你本机 请切换到相应的地址
apollo-configservice、apollo-adminservice 请运行再同一台电脑上

1.apollo-configservice:
使用如下命令:
Java -Dapollo_profile=github -Dspring.datasource.url=jdbc:mysql://localhost:3306/apolloconfigdb?characterEncoding=utf8 -Dspring.datasource.username=root -Dspring.datasource.password=root -jar apollo-configservice-1.7.1.jar

2.apollo-adminservice:
使用如下命令:
Java -Dapollo_profile=github -Dspring.datasource.url=jdbc:mysql://localhost:3306/apolloconfigdb?characterEncoding=utf8 -Dspring.datasource.username=root -Dspring.datasource.password=root -jar apollo-adminservice.jar

3.apollo-portal-1.7.1:
使用如下命令:
Java -Dapollo_profile=github,auth -Ddev_meta=http://localhost:8080/ -Dserver.port=8070 -Dspring.datasource.url=jdbc:mysql://localhost:3306/ApolloPortalDB?characterEncoding=utf8 -Dspring.datasource.username=root -Dspring.datasource.password=root -jar apollo-portal-1.7.1.jar

异常处理:

1.出现如下错误时,再数据库设置数据库的时间 ,运行

 set global time_zone='+8:00'
java.sql.SQLException: The server time zone value '?й???????' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76)
        at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835)
        at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455)
        at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)
        at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:117)
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:123)
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:365)
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:194)
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:460)
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:534)
        at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
        at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
        at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151)
        at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)
        at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)
        at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:319)
        at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:356)
        at org.springframework.boot.autoconfigure.orm.jpa.DatabaseLookup.getDatabase(DatabaseLookup.java:72)
        at org.springframework.boot.autoconfigure.orm.jpa.JpaProperties.determineDatabase(JpaProperties.java:166)
        at org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.jpaVendorAdapter(JpaBaseConfiguration.java:111)
        at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration$$EnhancerBySpringCGLIB$$44732dea.CGLIB$jpaVendorAdapter$9(<generated>)
        at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration$$EnhancerBySpringCGLIB$$44732dea$$FastClassBySpringCGLIB$$b7a1b399.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:365)
        at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration$$EnhancerBySpringCGLIB$$44732dea.jpaVendorAdapter(<generated>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

百度云Demo地址:

链接:https://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4whttps://pan.baidu.com/s/1aOduMV7tFcu84_dFHvnR4w 
提取码:jhtq 
复制这段内容后打开百度网盘手机App,操作更方便哦

Apollo官网地址:

https://ctripcorp.github.io/apollo/#/zh/development/apollo-development-guide

Apollo开发文档地址:

https://github.com/ctripcorp/apollo
版权声明1:本文来源CSDN,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/weixin_44310519/article/details/111626342
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2021-12-12 00:43
  • 阅读 ( 686 )

0 条评论

请先 登录 后评论

官方社群