Config LMDB Expansion and Backup Recovery
Cause of failure
Config LMDB is used to store configuration information for OpenResty Edge Nodes. Configuration synchronization fails when the required space exceeds the specified size (currently defaulted to 4 GB).
If the following error log appears in the /usr/local/oredge-node/logs/error.log file, it indicates that the required size of the config LMDB has exceeded the currently configured size.
2022/01/20 15:06:48 [emerg] 3162826#3162826: unable to commit: MDB_MAP_FULL: Environment mapsize limit reached
2022/01/20 15:06:48 [error] 3162826#3162826: *1041049 [lua] sync.lua:417: apply delta failed: failed to set requested key-values, context: ngx.timer
2022/01/20 15:06:48 [error] 3162826#3162826: *1041049 [lua] sync.lua:501: unable to synchronize with edge-admin err:failed to set requested key-values, context: ngx.timer
Impact of failure
Configuration synchronization is no longer possible.
Troubleshooting
Expansion Steps in new Versions
Please note: the space of LMDB can only be expanded, not reduced.
Run the script expand-config-lmdb.sh
to perform expansion. The script supports specifying the file size after expansion, with the unit in megabytes.
This script was first introduced in OpenResty Edge 25.6.15-1
.
For example, adjust the size to 8192m (8GB).
sudo /usr/local/oredge-node/bin/expand-config-lmdb.sh 8192
Expansion Steps in Older Versions
If your OpenResty Edge version is lower than 25.6.15-1
, you need to manually modify the configuration files for expansion.
Modify nginx.conf configuration: /usr/local/oredge-node/conf/nginx.conf
lua_config_map_size 4096m;
Change the size to the required value, such as 8192m (8GB).
Modify config.ini configuration: /usr/local/oredge-node/conf/config.ini
[config] lmdb_size = 4096m
Change the size to the required value, such as 8192m (8GB).
Restart OpenResty Edge Node
systemctl start upgrade-oredge-node
Check if the configuration has taken effect:
ls -lh /usr/local/oredge-node/data/config.lmdb
If you see the size has changed to the configured size (e.g., 8GB), it means the configuration is effective.