sonic-buildimage/files/build_templates
Dong Zhang 768beb79e1 create multiple Redis DB instances based on CONFIG at /etc/sonic/database_config.json (#2182)
this is the first step to moving different databases tables into different database instances

in this PR, only handle multiple database instances creation based on user configuration at /etc/sonic/database_config.json

we keep current method to create single database instance if no extra/new DATABASE configuration exist in database_config.json file.

if user try to configure more db instances at database_config.json , we create those new db instances along with the original db instance existing today.

The configuration is as below, later we can add more db related information if needed:
{
...
"DATABASE": {
"redis-db-01" : {
"port" : "6380",
"database": ["APPL_DB", "STATE_DB"]
},
"redis-db-02" : {
"port" : "6381",
"database":["ASIC_DB"]
},
}
...
}

The detail description is at design doc at Azure/SONiC#271

The main idea is : when database.sh started, we check the configuration and generate corresponding scripts.

rc.local service handle old_config copy when loading new images, there is no dependency between rc.local and database service today, for safety and make sure the copy operation are done before database try to read it, we make database service run after rc.local

Then database docker started, we check the configuration and generate corresponding scripts/.conf in database docker as well.

based on those conf, we create databases instances as required.

at last, we ping_pong check database are up and continue


Signed-off-by: Dong Zhang d.zhang@alibaba-inc.com
2019-08-28 11:15:10 -07:00
..
bgp.service.j2 [services] Services which start containers now use 'docker wait' instead of 'docker attach' (#2661) 2019-03-08 10:59:41 -08:00
buffers_config.j2 [qos]: Map tc 1, 2, 5, and 6 back to pg 0 (#2650) 2019-03-08 02:23:32 -08:00
database.service.j2 create multiple Redis DB instances based on CONFIG at /etc/sonic/database_config.json (#2182) 2019-08-28 11:15:10 -07:00
dhcp_relay.service.j2 [services] Restart SwSS service upon unexpected critical process exit (#2845) 2019-05-01 08:02:38 -07:00
docker_image_ctl.j2 create multiple Redis DB instances based on CONFIG at /etc/sonic/database_config.json (#2182) 2019-08-28 11:15:10 -07:00
lldp.service.j2 [services] Services which start containers now use 'docker wait' instead of 'docker attach' (#2661) 2019-03-08 10:59:41 -08:00
organization_extensions.sh Framework to plugin Organization specific scripts during ONIE Image build (#951) 2017-09-19 16:23:31 -07:00
pmon.service.j2 [services] Services which start containers now use 'docker wait' instead of 'docker attach' (#2661) 2019-03-08 10:59:41 -08:00
qos_config.j2 [qos]: Map tc 1, 2, 5, and 6 back to pg 0 (#2650) 2019-03-08 02:23:32 -08:00
radv.service.j2 [radv service] radv service should be a cold only dependent of swss (#3348) 2019-08-16 12:08:46 -07:00
snmp.service.j2 [services] Restart SwSS service upon unexpected critical process exit (#2845) 2019-05-01 08:02:38 -07:00
snmp.timer Enable sairedis counter thread in 3 minutes after SONiC was started (#1805) 2018-06-22 19:53:51 -07:00
sonic_debian_extension.j2 [build]: Move Systemd service start to systemd generator (#3172) 2019-07-29 15:52:15 -07:00
swss.service.j2 [submodule] update sonic-linux-kernel (#2985) 2019-06-18 10:00:16 -07:00
syncd.service.j2 [submodule] update sonic-linux-kernel (#2985) 2019-06-18 10:00:16 -07:00
teamd.service.j2 [service dependent] describe non-warm-reboot dependency outside systemd (#3311) 2019-08-08 15:45:17 -07:00
telemetry.service.j2 [telemetry]: change the service dependency from swss to database (#3072) 2019-06-24 12:36:16 -07:00
updategraph.service.j2 [mellanox]: Upgraded hw-management V.2.0.0160. (#2643) 2019-03-06 18:51:46 -08:00