- manually add “elasticsearch” to node <elasticsearch7_server_hostname> in vendor/magento/module-elasticsearch-7/etc/config.xml
- disable elasticsearch6 and enable elasticsearch7 module
bin/magento module:enable {Magento_Elasticsearch,Magento_InventoryElasticsearch,Magento_Elasticsearch(version)}
bin/magento module:disable Magento_Elasticsearch(previous version)