@Override
    public String getMasterUrl() {
        ClusterMasterDO master = clusterMasterMapper.selectById(MASTER_ID);
        String contextPath = master.getContextPath();
        if (StringUtils.isEmpty(contextPath)) {
            return clusterProperties.getSchema() + "://" + master.getMasterHost() + ":" + master.getMasterPort();
        }
        if (contextPath.startsWith("/")) {
            return clusterProperties.getSchema() + "://" + master.getMasterHost() + ":" + master.getMasterPort() + contextPath;
        }
        return clusterProperties.getSchema() + "://" + master.getMasterHost() + ":" + master.getMasterPort() + "/" + contextPath;
    }
The cluster select master service jdbc impl.
shenyu-admin/src/main/java/org/apache/shenyu/admin/mode/cluster/impl/jdbc/ClusterSelectMasterServiceJdbcImpl.java