apollo安装部署

news/2025/3/30 18:58:27/文章来源:https://www.cnblogs.com/hxlasky/p/18795881

环境:
OS:Centos 7
apollo:2.4

 

1.安装mysql
参考安装连接
https://www.cnblogs.com/hxlasky/p/12346365.html

 

2.安装好java环境

[root@node2 conf]# java -version
java version "21.0.6" 2025-01-21 LTS
Java(TM) SE Runtime Environment (build 21.0.6+8-LTS-188)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.6+8-LTS-188, mixed mode, sharing)

 

3.安装好git

[root@node2 apoll]# git version
git version 1.8.3.1

 

4.下载安装包

wget https://github.com/apolloconfig/apollo/releases/download/v2.4.0/apollo-configservice-2.4.0-github.zip
wget https://github.com/apolloconfig/apollo/releases/download/v2.4.0/apollo-adminservice-2.4.0-github.zip
wget https://github.com/apolloconfig/apollo/releases/download/v2.4.0/apollo-portal-2.4.0-github.zip
wget https://github.com/apolloconfig/apollo/archive/refs/tags/v2.4.0.zip

 


5.创建目录解压部署包
mkdir -p /opt/{apollo-adminservice,apollo-configservice,apollo-portal,apollo-source}

 

6.解压安装包

[root@node2 apoll]# cd /soft/apoll
[root@node2 apoll]#unzip apollo-2.4.0.zip -d /opt/apollo-source/
[root@node2 apoll]#unzip apollo-adminservice-2.4.0-github.zip -d /opt/apollo-adminservice/
[root@node2 apoll]#unzip apollo-configservice-2.4.0-github.zip -d /opt/apollo-configservice/
[root@node2 apoll]#unzip apollo-portal-2.4.0-github.zip -d /opt/apollo-portal/

 

7.修改apollo配置文件
7.1 修改apollo-adminservice配置文件

cd /opt/apollo-adminservice/config
[root@node2 config]# ls
application-github.properties application.properties

vi application-github.properties

原来的

spring.datasource.url = jdbc:mysql://fill-in-the-correct-server:3306/ApolloConfigDB?characterEncoding=utf8
spring.datasource.username = FillInCorrectUser
spring.datasource.password = FillInCorrectPassword

修改为

spring.datasource.url = jdbc:mysql://192.168.1.106:3306/ApolloConfigDB?characterEncoding=utf8
spring.datasource.username = root
spring.datasource.password = mysql

 

7.2 修改apollo-configservice配置文件

[root@node2 config]#cd /opt/apollo-configservice/config 
[root@node2 config]# vi application-github.properties

原来的:

# DataSource
spring.datasource.url = jdbc:mysql://fill-in-the-correct-server:3306/ApolloConfigDB?characterEncoding=utf8
spring.datasource.username = FillInCorrectUser
spring.datasource.password = FillInCorrectPassword

修改为

# DataSource
spring.datasource.url = jdbc:mysql://192.168.1.106:3306/ApolloConfigDB?characterEncoding=utf8
spring.datasource.username = root
spring.datasource.password = mysql

 

7.3 修改apollo-portal配置文件

[root@node2 config]# cd /opt/apollo-portal/config
vi application-github.properties

原来的:

# DataSource
spring.datasource.url = jdbc:mysql://fill-in-the-correct-server:3306/ApolloPortalDB?characterEncoding=utf8
spring.datasource.username = FillInCorrectUser
spring.datasource.password = FillInCorrectPassword

修改为:

# DataSource
spring.datasource.url = jdbc:mysql://192.168.1.106:3306/ApolloPortalDB?characterEncoding=utf8
spring.datasource.username = root
spring.datasource.password = mysql

 

8.创建数据库

/opt/mysql57/bin/mysql -h 192.168.1.106 -uroot -pmysql
create database ApolloPortalDB;
create database ApolloConfigDB;

 

9.apollo基础数据导入

/opt/mysql57/bin/mysql -h 192.168.1.106 -uroot -pmysqluse ApolloPortalDB;
source /opt/apollo-source/apollo-2.4.0/scripts/sql/src/apolloportaldb.sql;use ApolloConfigDB;
source /opt/apollo-source/apollo-2.4.0/scripts/sql/src/apolloconfigdb.sql;

 

10.apollo启停命令
需要先启动mysql
/opt/mysql57/bin/mysqld_safe --defaults-file=/opt/mysql57/conf/my.cnf --user=mysql &

#启动服务 
sh /opt/apollo-configservice/scripts/startup.sh
sh /opt/apollo-adminservice/scripts/startup.sh
sh /opt/apollo-portal/scripts/startup.sh#停止服务
sh /opt/apollo-configservice/scripts/shutdown.sh
sh /opt/apollo-adminservice/scripts/shutdown.sh
sh /opt/apollo-portal/scripts/shutdown.sh

 

10.浏览器访问
http://192.168.1.105:8070
默认的账号密码是:
apollo/admin

 

输入 http://192.168.1.105:8080 如果出现eureka 的管理界面,说明服务启动正常。

 

12.日志目录
日志目录存在如下目录
/opt/logs

 

13.遇到的错误
界面提示:系统出错,请联系系统管理员

解决办法:

/opt/mysql57/bin/mysql -h 192.168.1.106 -uroot -pmysqlmysql> use apolloconfigdbmysql> select Id,`Key`,`Value` from serverconfig;
+----+------------------------------+-------------------------------+
| Id | Key                          | Value                         |
+----+------------------------------+-------------------------------+
|  1 | eureka.service.url           | http://localhost:8080/eureka/ |
|  2 | namespace.lock.switch        | false                         |
|  3 | item.key.length.limit        | 128                           |
|  4 | item.value.length.limit      | 20000                         |
|  5 | config-service.cache.enabled | false                         |
+----+------------------------------+-------------------------------+
5 rows in set (0.00 sec)

修改 eureka.service.url的localhost为服务器的ip地址

update serverconfigset `Value`='http://192.168.1.105:8080/eureka/'
where Id=1;

 

重启动
#停止服务
sh /opt/apollo-configservice/scripts/shutdown.sh
sh /opt/apollo-adminservice/scripts/shutdown.sh
sh /opt/apollo-portal/scripts/shutdown.sh#启动服务 
sh /opt/apollo-configservice/scripts/startup.sh
sh /opt/apollo-adminservice/scripts/startup.sh
sh /opt/apollo-portal/scripts/startup.sh

 

继续修改

vi /opt/apollo-portal/config/apollo-env.properties

原来的:

local.meta=http://localhost:8080
dev.meta=http://fill-in-dev-meta-server:8080
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

修改为:

local.meta=http://localhost:8080
dev.meta=http://192.168.1.105:8080
fat.meta=http://192.168.1.105:8080
uat.meta=http://192.168.1.105:8080
lpt.meta=${lpt_meta}
pro.meta=http://192.168.1.105:8080

 

重启动
#停止服务
sh /opt/apollo-configservice/scripts/shutdown.sh
sh /opt/apollo-adminservice/scripts/shutdown.sh
sh /opt/apollo-portal/scripts/shutdown.sh#启动服务 
sh /opt/apollo-configservice/scripts/startup.sh
sh /opt/apollo-adminservice/scripts/startup.sh
sh /opt/apollo-portal/scripts/startup.sh

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/906670.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【VMware vSAN】解决 vSAN 性能服务提示“统计信息主节点选举”问题。

VMware vSAN 集群出现了一个严重警告,提示:vSAN 性能服务警报“统计信息主节点选举”,如下图所示。根据警报名称描述,vSAN 运行状况服务在检查 vSAN 性能服务的统计信息主节点时触发错误,由“green”状态变更为“red”状态。导航到 vSAN 集群->监控->vSAN->Skyli…

Hessian曲线

题目: from Crypto.Util.number import * from flag import flagdef on_barak(P, E):c, d, p = Ex, y = Preturn (x**3 + y**3 + c - d*x*y) % p == 0def add_barak(P, Q, E):if P == (0, 0):return Qif Q == (0, 0):return Passert on_barak(P, E) and on_barak(Q, E)x1, y1 =…

RabbitMQ通过代码实现交换机分发模式

首先导入rabbitMQ的依赖:<!-- https://mvnrepository.com/artifact/com.rabbitmq/amqp-client --><dependency><groupId>com.rabbitmq</groupId><artifactId>amqp-client</artifactId><version>5.25.0</version></depende…

vue复基本语法

以下为你用表格形式呈现 Vue 3 基本语法:类别 语法示例 说明模板语法文本插值 <div>{{ message }}</div> 使用双大括号将数据显示在模板中属性绑定 <img :src="imageUrl" alt="示例图片"> :src 是 v-bind:src 的简写,用于动态绑定属性…

vue3-webseek网页版AI问答|Vite6+DeepSeek+Arco流式ai聊天打字效果

2025 AI实战vue3+deepseek+arcoDesign仿DeepSeek/豆包网页版AI聊天助手。 vue3-web-deepseek 实战网页PC版智能AI对话,基于vite6+vue3.5+openAI对接DeepSeek-Chat聊天对话模型。实现流动式打字返回效果、支持亮色+暗黑主题、各种代码高亮、本地会话存储等功能。🐬技术栈编码…

仓库呆滞物料堆积如山?十年的仓库主管跟我说了这五点

今天咱们聊聊一个经常让很多仓库管理者头疼的问题—— 仓库呆滞物料堆积 。 说实话,仓库呆滞物料堆得满满的,不仅占用宝贵的仓储空间,还让企业的资金周转变得紧张,真的是个大麻烦! 不过,之前我和一位拥有 十年经验的仓库主管 聊了聊,得到了很多宝贵的经验,特别是在如何…

【汇总】sqlcmd 命令选项说明-MSSQL2012

一、原始帮助D:\>sqlcmd /? Microsoft (R) SQL Server 命令行工具 版本 11.0.2100.60 NT x64 版权所有 (c) 2012 Microsoft。保留所有权利。用法: Sqlcmd [-U 登录 ID] [-P 密码][-S 服务器] [-H 主机名] [-E 可信连接][-N 加密连…

导入SpaceClaim的iges模型尺寸被放大1000倍的问题

ANSYS APDL 和 Workbench 联合仿真中,导入 Workbench 的 iges 模型尺寸被放大1000倍问题的解决方案问题 ANSYS APDL 和 Workbench 联合仿真时,导入 SpaceClaim 的 .iges 模型尺寸被放大 1000 倍数。 如 APDL 生成的尺寸为 10 mm(注:此处的 mm 是在 APDL 编码中设置的一致单…

Linux的vim编辑器

Linux的vi/vim编辑器 命令模式 编辑模式 输入模式 vi/ vim编辑器的基本操作Linux的vi/vim编辑器基本概念:vim文本编辑器,是由vi编辑器发展演变过来的文本编辑器,因其具有使用简单、功能强大、是 Linux 众多发行版的默认文本编辑器。很多人习惯将 vim 称为 vi,其实 vim 是 v…

高度场流体模拟

【USparkle专栏】如果你深怀绝技,爱“搞点研究”,乐于分享也博采众长,我们期待你的加入,让智慧的火花碰撞交织,让知识的传递生生不息!一、原理参考这个论文:《Real-time Simulation of Large Bodies of Water with Small Scale Details》 核心是这两个公式: 我在这篇《…