CentOS 7 安装 Apollo
2023-09-14 09:06:42 时间
本列演示多环境部署,要启用2个虚拟机
192.168.2.104 dev
192.168.2.107 pro
192.168.2.104 dev
1、下载,需要3个包,官方已经更新到 1.61 版本
cd /usr/local/src
# apollo-adminservice
wget https://github.com/ctripcorp/apollo/releases/download/v1.6.1/apollo-adminservice-1.6.1-github.zip
# apollo-configservice
wget https://github.com/ctripcorp/apollo/releases/download/v1.6.1/apollo-configservice-1.6.1-github.zip
# apollo-portal
wget https://github.com/ctripcorp/apollo/releases/download/v1.6.1/apollo-portal-1.6.1-github.zip
2、解压到相关目录
mkdir /usr/local/apollo
unzip apollo-adminservice-1.6.1-github.zip -d /usr/local/apollo/apollo-adminservice
unzip apollo-configservice-1.6.1-github.zip -d /usr/local/apollo/apollo-configservice
unzip apollo-portal-1.6.1-github.zip -d /usr/local/apollo/apollo-portal
3、创建数据库
https://github.com/nobodyiam/apollo-build-scripts/tree/master/sql
需要创建 2个数据库 ApolloConfigDB,ApolloPortalDB,并导入上面的SQL
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| ApolloConfigDB |
| ApolloPortalDB |
| mysql |
| performance_schema |
| sys |
+--------------------+
4、修改 3个 服务的配置文件
cd /usr/local/apollo/
# apollo-adminservice
vim apollo-adminservice/config/application-github.properties
# DataSource
spring.datasource.url = jdbc:mysql://192.168.2.104:3306/ApolloConfigDB?characterEncoding=utf8
spring.datasource.username = root
spring.datasource.password = Abc@123456
# apollo-configservice
vim apollo-configservice/config/application-github.properties
# DataSource
spring.datasource.url = jdbc:mysql://192.168.2.104:3306/ApolloConfigDB?characterEncoding=utf8
spring.datasource.username = root
spring.datasource.password = Abc@123456
# apollo-portal
vim apollo-portal/config/application-github.properties
# DataSource
spring.datasource.url = jdbc:mysql://192.168.2.104:3306/ApolloPortalDB?characterEncoding=utf8
spring.datasource.username = root
spring.datasource.password = Abc@123456
5、修改 apollo-configservice 服务地址
分别是不同环境下的服务地址,这里只配置了(开发-dev)环境下的地址
vim apollo-portal/config/apollo-env.properties
dev.meta=http://192.168.2.104:8080
# 这个环境下面会配置
pro.meta=http://192.168.2.107:8080
6、修改数据库地址
ApolloPortalDB 库 ServerConfig 表 apollo.portal.envs 中的值 Value 改成 dev,pro
7、创建启动脚本
vim start.sh
#!/bin/bash
/usr/local/apollo/apollo-configservice/scripts/startup.sh
/usr/local/apollo/apollo-adminservice/scripts/startup.sh
/usr/local/apollo/apollo-portal/scripts/startup.sh
vim shutdown.sh
#!/bin/bash
/usr/local/apollo/apollo-adminservice/scripts/shutdown.sh
/usr/local/apollo/apollo-configservice/scripts/shutdown.sh
/usr/local/apollo/apollo-portal/scripts/shutdown.sh
8、启动成功
./start.sh
Started [9603]
Waiting for server startup.........
Fri May 29 04:48:05 CST 2020 Server started in 45 seconds!
Fri May 29 04:48:06 CST 2020 ==== Starting ====
Started [9855]
Waiting for server startup.....
pid - 9855 just quit unexpectedly, please check logs under /opt/logs/100003172 and /tmp for more information!
Fri May 29 04:48:31 CST 2020 ==== Starting ====
Started [10002]
Waiting for server startup......
Fri May 29 04:49:02 CST 2020 Server started in 30 seconds!
9、访问
http://192.168.2.104:8070/ 账号:apollo 密码:admin
192.168.2.107 pro
1、下载,需要2个包,pro环境只需要部署 adminservcie,configservice
cd /usr/local/src
# apollo-adminservice
wget https://github.com/ctripcorp/apollo/releases/download/v1.6.1/apollo-adminservice-1.6.1-github.zip
# apollo-configservice
wget https://github.com/ctripcorp/apollo/releases/download/v1.6.1/apollo-configservice-1.6.1-github.zip
2、解压到相关目录
cd /usr/local/src
# apollo-adminservice
wget https://github.com/ctripcorp/apollo/releases/download/v1.6.1/apollo-adminservice-1.6.1-github.zip
# apollo-configservice
wget https://github.com/ctripcorp/apollo/releases/download/v1.6.1/apollo-configservice-1.6.1-github.zip
3、创建数据库,把上面的ApolloConfigDB复制一个改成 ApolloConfigProDB
4、修改pro环境配置文件
cd /usr/local/apollo/
# apollo-adminservice
vim apollo-adminservice/config/application-github.properties
# DataSource
spring.datasource.url = jdbc:mysql://192.168.2.104:3306/ApolloConfigProDB?characterEncoding=utf8
spring.datasource.username = root
spring.datasource.password = Abc@123456
---------------------------------------------------------------------
# apollo-configservice
vim apollo-configservice/config/application-github.properties
# DataSource
spring.datasource.url = jdbc:mysql://192.168.2.104:3306/ApolloConfigProDB?characterEncoding=utf8
spring.datasource.username = root
spring.datasource.password = Abc@123456
5、启动脚本,并启动
vim start.sh
#!/bin/bash
/usr/local/apollo/apollo-configservice/scripts/startup.sh
/usr/local/apollo/apollo-adminservice/scripts/startup.sh
6、重新启动 192.168.2.104 启动脚本
查看
相关文章
- CentOS 7安装Redis
- centos下软件安装
- Linux/CentOS 服务安装/卸载,开机启动chkconfig命令详解|如何让MySQL、Apache开机启动?
- CentOS 6.4下安装配置Spark-0.9集群
- CentOS中安装MySQL数据库
- Linux CentOS 6.6安装JDK1.7
- Install SVN (Subversion) Server on Fedora 20/19, CentOS/Red Hat (RHEL) 6.5/5.10
- Centos下修改hostname
- 在CENTOS上安装APACHE,MUNIN(对MONGODB的PLUGIN未成功)
- CentOS 6.4 YUM 安装MySQL Proxy
- centos 7 五笔安装
- centos笔记1--安装服务后启动不识别
- centos 如何查看用户
- CentOS 6.4 64-bit编译安装ffmpeg
- Centos 7.6搭建Tomcat 环境,发布Java项目
- centos下 Apache、php、mysql默认安装路径
- Linux centos环境 安装谷歌浏览器
- Linux(CentOS)安装JDK(.tar.gz)并配置
- [记]Centos下流量统计使用记录
- centos top命令列解释
- Linux系统之MobaXterm远程连接centos的GNOME桌面环境
- CentOS 7 源码编译安装openssl —— 筑梦之路
- CentOS curl命令
- CentOS Linux搭建SVN服务器
- CentOS下通过yum安装svn及配置
- CentOS下使用yum快速安装memcached
- linux(centos)中部署docker(步骤超全,含带一些发展史和一些概念)
- CentOS 7 安装 Ansible
- CentOS 6.8 安装Redis 4.0.9