How to setup multi odoo instances in AWS

Target deployment diagram

在这里插入图片描述
Our target deployment environment in AWS is like above diagram. we have two odoo system running on two AWS EC2 Ubuntu instances, the two instances will share odoo data file using AWS EFS, so the two odoo instances can share same data files. All requests will go to AWS load balancer via domain name on 80 port. The Postgresql12 database setup in AWS RDS instance, odoo instance1, instance2 remotely connect to the Postgresql12 RDS instance, so the two odoo instances always share the same databse.

1, Setup AWS RDS PostgreSQL Instance

  • Go to Amzon RDS services, create PostgreSQL 12.3 Database following the instructions. if you need public access outside the VPC, make sure you check the ‘Public accessibility’ options to ‘Yes’.
  • After DB created, you will get the Endpoint details like:
    database-postgresql1-test.xxxxx-southeast-1.rds.amazonaws.com
  • Check the database security group, make sure it allow access on the DB port
  • Connect to DB instance, the host is your RDS DB instance Endpoint
psql --host=database-postgresql1-test.xxxxx-southeast-1.rds.amazonaws.com --port=5432 --username=postgres --password --dbname=postgres
  • Create odoo user: odoo12 and database: odoo
postgres=> CREATE ROLE odoo12;
CREATE ROLE

postgres=> GRANT odoo12 TO postgres;
GRANT ROLE

postgres=> CREATE DATABASE odoo OWNER = odoo12;
CREATE DATABASE
  • Restore the database from existing odoo EC2 instance.

If you want to migrate existing DB to the RDS odoo DB, you need login the EC2 instance, dump the existing db to sql file, then restore it to the RDS DB instance. In EC2 instance, do below:

# dump existing db to sql file:
$ pg_dump -h localhost -p 5432 -U odoo12 odoo > db_backup.sql
#restore the dump file to RDS DB instance, host is the instance Endpoint
$ psql -f db_backup.sql --host database-postgresql1-test.xxxxx-southeast-1.rds.amazonaws.com --port 5432 --username odoo12 --dbname odoo

2, Setup AWS Elastic File System

  • Go to AWS EFS services and follow the instructions to create EFS, this EFS will attach to our two EC2 odoo instances later.
  • Mount the EFS in the two EC2 instances, directory name like ‘efs’, the EFS directory can only be accessed by root user after mount, need to change the directory owner to odoo user. we have odoo12 user in the EC2 instance, change owner:
  • sudo chown odoo12:odoo12 /efs

3, Config odoo instances

  • Login both EC2 instances, that you can see and access the EFS directory.
  • Copy your odoo data file to this EFS directory
  • Config the two odoo instances to connect to the RDS Postgresql instance and also change the data_dir to the EFS directory. Change db_host to the Endpoint of RDS instance.
 db_host = database-postgresql1-test.xxxxx-southeast-1.rds.amazonaws.com 
 data_dir = /opt/efs/data/Odoo
  • Start odoo service for both instance1 and 2.

4, Create Load Balancer in AWS

  • Create load balancer in AWS
  • Register the two odoo EC2 instances to the created load balancer
  • Refer to article below for the details of setup domain and load balancer.
    Setup Odoo12 service in AWS
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值