getting keys from local and remote nodes for merging.