1, pre-preparation work
Target server requires the deployment of Apollo:
(1) Linux distributions recommend CentOS7 (due to the Apollo service built three JVM process all the system memory available to recommend no less than 2G)
(2) installation of Oracle version 10g + (as Apollo deploy Oracle service is also available borrowing has deployed Oracle services)
(3) install JDK version 1.8+
(4) installation Docker version 1.13+
(5) installation docker-compose
yum -y install epel-release
yum -y install python-pip
pip install docker-compose
(6) Installation tool unzip it ZIP unzip the install yum
(. 7) assuming that IP server is as follows:
Oracle部署所在服务器IP为 Oracle_IP(下文均通过这个来指代) ,实例名称为xe,两组用户apolloconfig/apollo和apolloportal/apollo
Apollo部署所在服务器IP为 Apollo_IP(下文均通过这个来指代)
特别注意:由于业务系统需要访问Apollo获取配置,如果Apollo_IP和业务系统不再一个局域网,那么Apollo_IP必须是外网IP,同理,由于Apollo需要访问Oracle,如果Oracle_IP和Apollo_IP不属于同一个局域网,Oracle_IP也必须是外网IP
2, download Apollo initial installation files apollo-oracle-docker.zip
3, local decompression initial setup files, modify the connection configuration information related Apollo
Unpack the file directory is:
Apollo-config \
Apollo-ADMIN \
Apollo-Portal \
SQL \
Docker-compose.yml
(1) modify the docker-compose.yml
Substituted for Oracle_IP, SID, Apollo_IP
version: "3"
services:
apollo-config: ##容器服务名
container_name: apollo-config ##容器名
build: apollo-config/ ##Dockerfile路径
image: apollo-config ##镜像名
ports:
- "8847:8847"
volumes:
- "/opt/logs/100003171:/opt/logs/100003171" ##将容器中应用日志挂载到宿主机的/opt/logs/100003171方便在宿主机上查看日志
environment:
- spring_datasource_url=jdbc:oracle:thin:@Oracle_IP:1521/SID
- spring_datasource_username=apolloconfig
- spring_datasource_password=apollo
- JAVA_OPTS=-Deureka.instance.ip-address=Apollo_IP
apollo-admin:
container_name: apollo-admin
build: apollo-admin/
image: apollo-admin
ports:
- "8090:8090"
depends_on:
- apollo-config
volumes:
- "/opt/logs/100003172:/opt/logs/100003172"
environment:
- spring_datasource_url=jdbc:oracle:thin:@Oracle_IP:1521/SID
- spring_datasource_username=apolloconfig
- spring_datasource_password=apollo
apollo-portal:
container_name: apollo-portal
build: apollo-portal/
image: apollo-portal
ports:
- "8070:8070"
depends_on:
- apollo-admin
volumes:
- "/opt/logs/100003173:/opt/logs/100003173"
environment:
- spring_datasource_url=jdbc:oracle:thin:@Oracle_IP:1521/SID
- spring_datasource_username=apolloportal
- spring_datasource_password=apollo
- JAVA_OPTS=-Dpro_meta=http://Apollo_IP:8847
See point 4 "Apollo-oracle- normal deployment embodiment" in - (2) into the script database sql
相比普通部署,docker部署这里导入SQL后需要到ApolloConfigDB找到"ServerConfig"表将eureka.service.url的值修改为http://Apollo_IP:8847/eureka/
apollo-oracle-docker.zip 4, use SFTP tool to modify and re-upload compressed to target Linux server at the specified directory such as / home / apollo, and then run the following command sequence in this catalog:
(1)unzip apollo-oracle-docker.zip
(2)docker-compose up -d
Wait and watch the log output (about 5 minutes), if it is enabled for success as follows:
特别说明:看到上述日志输出说明启动命令执行成功,但是Apollo服务访问还需要等待一段时间(再耐心等待几分钟)
5, the successful launch your browser http: 8070 Apollo configured access center: // Apollo_IP (make the appropriate configuration changes after the account has been included under the relevant configuration to log all the items needed for the operation to meet the project needs to run) default dongzs / dongzs Login
6, the implementation of docker-compose down can turn off the Apollo service
=================================================================
7, the mirror is mounted on the deployment Docker:
(1)apolloconfig的启动
docker run -d
-e spring_datasource_url=jdbc:oracle:thin:@Oracle_IP:1521:SID
-e spring_datasource_username=apolloconfig
-e spring_datasource_password=apollo
-e JAVA_OPTS=-Deureka.instance.ip-address=Apollo_IP
-p 8847:8847
-v /opt/logs/100003171:/opt/logs/100003171
-it registry.cn-hangzhou.aliyuncs.com/sw/apolloconfig-ora:1.2.0
(2)apolloadmin的启动
docker run -d
-e spring_datasource_url=jdbc:oracle:thin:@Oracle_IP:1521:SID
-e spring_datasource_username=apolloconfig
-e spring_datasource_password=apollo
-p 8090:8090
-v /opt/logs/100003172:/opt/logs/100003172
-it registry.cn-hangzhou.aliyuncs.com/sw/apolloadmin-ora:1.2.0
(3)apolloportal的启动
docker run -d
-e spring_datasource_url=jdbc:oracle:thin:@Oracle_IP:1521:SID
-e spring_datasource_username=apolloportal
-e spring_datasource_password=apollo
-e JAVA_OPTS=-Dpro_meta=http://Apollo_IP:8847
-p 8070:8070
-v /opt/logs/100003173:/opt/logs/100003173
-it registry.cn-hangzhou.aliyuncs.com/sw/apolloportal-ora:1.2.0