diff --git a/server/modules/routing/schemarouter/schemarouterinstance.cc b/server/modules/routing/schemarouter/schemarouterinstance.cc
index 8601e9bf6e..030b4c8e12 100644
--- a/server/modules/routing/schemarouter/schemarouterinstance.cc
+++ b/server/modules/routing/schemarouter/schemarouterinstance.cc
@@ -25,6 +25,7 @@
 #include <maxscale/modutil.hh>
 #include <maxscale/router.hh>
 #include <maxscale/secrets.hh>
+#include <maxscale/modulecmd.hh>
 
 using std::string;
 
@@ -229,6 +230,20 @@ uint64_t SchemaRouter::getCapabilities() const
 {
     return schemarouter::CAPABILITIES;
 }
+
+void SchemaRouter::clear_cache()
+{
+    m_shard_manager.clear();
+}
+
+bool clear_cache(const MODULECMD_ARG* args, json_t** error_out)
+{
+    mxb_assert(MODULECMD_GET_TYPE(&args->argv[0].type) == MODULECMD_ARG_SERVICE);
+
+    SchemaRouter* router = static_cast<SchemaRouter*>(args->argv[0].value.service->router());
+    router->clear_cache();
+    return true;
+}
 }
 
 /**
@@ -244,6 +259,16 @@ extern "C" MXS_MODULE* MXS_CREATE_MODULE()
     static auto desc = "A database sharding router for simple sharding";
     auto* api_ptr = &mxs::RouterApi<schemarouter::SchemaRouter>::s_api;
 
+    static modulecmd_arg_type_t clear_cache_argv[] =
+    {
+        {MODULECMD_ARG_SERVICE | MODULECMD_ARG_NAME_MATCHES_DOMAIN, "Schemarouter instance"}
+    };
+
+    modulecmd_register_command(
+        MXB_MODULE_NAME, "clear-cache", MODULECMD_TYPE_ACTIVE,
+        schemarouter::clear_cache, MXS_ARRAY_NELEMS(clear_cache_argv), clear_cache_argv,
+        "Clear the the shard map cache.");
+
     static MXS_MODULE info =
     {
         mxs::MODULE_INFO_VERSION,
diff --git a/server/modules/routing/schemarouter/schemarouterinstance.hh b/server/modules/routing/schemarouter/schemarouterinstance.hh
index 4d2aa97742..efd9fbb838 100644
--- a/server/modules/routing/schemarouter/schemarouterinstance.hh
+++ b/server/modules/routing/schemarouter/schemarouterinstance.hh
@@ -44,6 +44,11 @@ public:
         return m_config;
     }
 
+    /**
+     * Clear the shard map cache
+     */
+    void clear_cache();
+
 private:
     friend class SchemaRouterSession;
 
diff --git a/server/modules/routing/schemarouter/shard_map.cc b/server/modules/routing/schemarouter/shard_map.cc
index 543f85c0f1..47f493e885 100644
--- a/server/modules/routing/schemarouter/shard_map.cc
+++ b/server/modules/routing/schemarouter/shard_map.cc
@@ -235,3 +235,9 @@ void ShardManager::cancel_update(const std::string& user)
     mxb_assert(m_limits[user] > 0);
     --m_limits[user];
 }
+
+void ShardManager::clear()
+{
+    std::lock_guard<std::mutex> guard(m_lock);
+    m_maps.clear();
+}
diff --git a/server/modules/routing/schemarouter/shard_map.hh b/server/modules/routing/schemarouter/shard_map.hh
index 0920b9f1e3..f3fd4fcb68 100644
--- a/server/modules/routing/schemarouter/shard_map.hh
+++ b/server/modules/routing/schemarouter/shard_map.hh
@@ -184,6 +184,11 @@ public:
      */
     void cancel_update(const std::string& user);
 
+    /**
+     * Clear all the cached entries
+     */
+    void clear();
+
 private:
     mutable std::mutex m_lock;
     ShardMap           m_maps;
