Apollo-oracle-docker部署

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

  1. yum -y install epel-release
  2. yum -y install python-pip
  3. pip install docker-compose

(6) Installation tool unzip it ZIP unzip the install yum
(. 7) assuming that IP server is as follows:

  1. Oracle部署所在服务器IP Oracle_IP(下文均通过这个来指代) ,实例名称为xe,两组用户apolloconfig/apolloapolloportal/apollo
  2. Apollo部署所在服务器IP Apollo_IP(下文均通过这个来指代)
  3. 特别注意:由于业务系统需要访问Apollo获取配置,如果Apollo_IP和业务系统不再一个局域网,那么Apollo_IP必须是外网IP,同理,由于Apollo需要访问Oracle,如果Oracle_IPApollo_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

  1. version: "3"
  2. services:
  3. apollo-config: ##容器服务名
  4. container_name: apollo-config ##容器名
  5. build: apollo-config/ ##Dockerfile路径
  6. image: apollo-config ##镜像名
  7. ports:
  8. - "8847:8847"
  9. volumes:
  10. - "/opt/logs/100003171:/opt/logs/100003171" ##将容器中应用日志挂载到宿主机的/opt/logs/100003171方便在宿主机上查看日志
  11. environment:
  12. - spring_datasource_url=jdbc:oracle:thin:@Oracle_IP:1521/SID
  13. - spring_datasource_username=apolloconfig
  14. - spring_datasource_password=apollo
  15. - JAVA_OPTS=-Deureka.instance.ip-address=Apollo_IP
  16. apollo-admin:
  17. container_name: apollo-admin
  18. build: apollo-admin/
  19. image: apollo-admin
  20. ports:
  21. - "8090:8090"
  22. depends_on:
  23. - apollo-config
  24. volumes:
  25. - "/opt/logs/100003172:/opt/logs/100003172"
  26. environment:
  27. - spring_datasource_url=jdbc:oracle:thin:@Oracle_IP:1521/SID
  28. - spring_datasource_username=apolloconfig
  29. - spring_datasource_password=apollo
  30. apollo-portal:
  31. container_name: apollo-portal
  32. build: apollo-portal/
  33. image: apollo-portal
  34. ports:
  35. - "8070:8070"
  36. depends_on:
  37. - apollo-admin
  38. volumes:
  39. - "/opt/logs/100003173:/opt/logs/100003173"
  40. environment:
  41. - spring_datasource_url=jdbc:oracle:thin:@Oracle_IP:1521/SID
  42. - spring_datasource_username=apolloportal
  43. - spring_datasource_password=apollo
  44. - JAVA_OPTS=-Dpro_meta=http://Apollo_IP:8847

See point 4 "Apollo-oracle- normal deployment embodiment" in - (2) into the script database sql

  1. 相比普通部署,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:

  1. 特别说明:看到上述日志输出说明启动命令执行成功,但是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

Guess you like

Origin www.cnblogs.com/manu24/p/11876027.html