apollo linux安裝部署


apollo linux安裝部署

apollo工程地址

gitree地址:https://gitee.com/apolloconfig/apollo

github地址: https://github.com/apolloconfig/apollo

  • 下載工程目錄如下

  • 創建數據庫

    數據庫在scrpits>>sql 目錄下

    apolloconfigdb.sql

    apolloportaldb.sql

源碼編譯部署

  • 多環境部署,configservice、adminservice需要在每台服務器上分別部署一套; portal只需要部署一套即可
  • 修改配置文件

當前電腦為windows電腦,目前只用到了開發環境dev和生成環境prod,打包會用到scprits/build.bat文件

修改一下build.bat文件內容,注意數據庫連接串要根據不同的mysql版本做修改

meta server url 目前只用到了dev 和 prod

  • portal 172.16.100.13
  • 測試環境:172.16.100.13
  • 生產環境:172.16.100.5
rem
rem Copyright 2021 Apollo Authors
rem
rem Licensed under the Apache License, Version 2.0 (the "License");
rem you may not use this file except in compliance with the License.
rem You may obtain a copy of the License at
rem
rem http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.
rem
@echo off

rem apollo config db info
set apollo_config_db_url="jdbc:mysql://172.16.100.13:3306/ApolloConfigDB?serverTimezone=GMT%2b8&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2b8"
set apollo_config_db_username="root"
set apollo_config_db_password="密碼"

rem apollo portal db info
set apollo_portal_db_url="jdbc:mysql://172.16.100.13:3306/ApolloPortalDB?serverTimezone=GMT%2b8&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2b8"
set apollo_portal_db_username="root"
set apollo_portal_db_password="密碼"

rem meta server url, different environments should have different meta server addresses
set dev_meta="http://172.16.100.13:8080"
#set fat_meta="http://someIp:8080"
#set uat_meta="http://anotherIp:8080"
set pro_meta="http://172.16.100.5:8080"

set META_SERVERS_OPTS=-Ddev_meta=%dev_meta% -Dfat_meta=%fat_meta% -Duat_meta=%uat_meta% -Dpro_meta=%pro_meta%

rem =============== Please do not modify the following content =============== 
rem go to script directory
cd "%~dp0"

cd ..

rem package config-service and admin-service
echo "==== starting to build config-service and admin-service ===="

call mvn clean package -DskipTests -pl apollo-configservice,apollo-adminservice -am -Dapollo_profile=github -Dspring_datasource_url=%apollo_config_db_url% -Dspring_datasource_username=%apollo_config_db_username% -Dspring_datasource_password=%apollo_config_db_password%

echo "==== building config-service and admin-service finished ===="

echo "==== starting to build portal ===="

call mvn clean package -DskipTests -pl apollo-portal -am -Dapollo_profile=github,auth -Dspring_datasource_url=%apollo_portal_db_url% -Dspring_datasource_username=%apollo_portal_db_username% -Dspring_datasource_password=%apollo_portal_db_password% %META_SERVERS_OPTS%

echo "==== building portal finished ===="

pause

編譯

  • 打開工程所在目錄
  • 打開cmd,執行build.bat命令
  • build完成后,分別拿zip包
  • apollo-configservice 下的 apollo-configservice-2.0.0-SNAPSHOT-github.zip
  • apollo-adminservice 下的 apollo-adminservice-2.0.0-SNAPSHOT-github.zip
  • apollo-portal 下的 apollo-portal-2.0.0-SNAPSHOT-github.zip
  • 放到服務器的相應目錄下,如圖

  • 分別檢查下配置文件是否正確,都在相關的目錄項的scprits目錄下
  • 檢查完配置文件后,啟動服務

啟動服務有順序

先啟動config service

在啟動admin service

最后啟動 portal

若為多台部署,也是分別在5上、13上啟用config service;在啟用admin service;最后啟用portal

服務啟動完成后,訪問頁面

portal所在服務器為 172.16.100.13

http://172.16.100.13:8070

apollo服務提供默認用戶名密碼 apollo/admin


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM