### Elasticsearch Version

docker.elastic.co/elasticsearch/elasticsearch:8.11.0

### Installed Plugins

N/A

### Java Version

_bundled_

### OS Version

MacOS Monterey 12.6

### Problem Description

Concurrent.ExecutionException","error.message":"java.lang.IllegalStateException: Can't move to stopped state when not started",

just look for "error" here:

```
elasticsearch-node3           | {"@timestamp":"2023-11-22T22:35:58.332Z", "log.level": "WARN", "message":"unexpected exception while waiting for http server to close", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"Thread-0","log.logger":"org.elasticsearch.node.Node","elasticsearch.node.name":"node3","elasticsearch.cluster.name":"mycluster","error.type":"java.util.concurrent.ExecutionException","error.message":"java.lang.IllegalStateException: Can't move to stopped state when not started","error.stack_trace":"java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Can't move to stopped state when not started\n\tat java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)\n\tat java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)\n\tat org.elasticsearch.server@8.11.0/org.elasticsearch.node.Node.prepareForClose(Node.java:1776)\n\tat org.elasticsearch.server@8.11.0/org.elasticsearch.bootstrap.Elasticsearch.shutdown(Elasticsearch.java:468)\n\tat java.base/java.lang.Thread.run(Thread.java:1583)\nCaused by: java.lang.IllegalStateException: Can't move to stopped state when not started\n\tat org.elasticsearch.server@8.11.0/org.elasticsearch.common.component.Lifecycle.canMoveToStopped(Lifecycle.java:128)\n\tat org.elasticsearch.server@8.11.0/org.elasticsearch.common.component.AbstractLifecycleComponent.stop(AbstractLifecycleComponent.java:73)\n\tat org.elasticsearch.server@8.11.0/org.elasticsearch.node.Node.lambda$prepareForClose$59(Node.java:1768)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)\n\t... 1 more\n"}
elasticsearch-node1           | {"@timestamp":"2023-11-22T22:35:58.333Z", "log.level": "WARN", "message":"unexpected exception while waiting for http server to close", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"Thread-0","log.logger":"org.elasticsearch.node.Node","elasticsearch.node.name":"node1","elasticsearch.cluster.name":"mycluster","error.type":"java.util.concurrent.ExecutionException","error.message":"java.lang.IllegalStateException: Can't move to stopped state when not started","error.stack_trace":"java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Can't move to stopped state when not started\n\tat java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)\n\tat java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)\n\tat org.elasticsearch.server@8.11.0/org.elasticsearch.node.Node.prepareForClose(Node.java:1776)\n\tat org.elasticsearch.server@8.11.0/org.elasticsearch.bootstrap.Elasticsearch.shutdown(Elasticsearch.java:468)\n\tat java.base/java.lang.Thread.run(Thread.java:1583)\nCaused by: java.lang.IllegalStateException: Can't move to stopped state when not started\n\tat org.elasticsearch.server@8.11.0/org.elasticsearch.common.component.Lifecycle.canMoveToStopped(Lifecycle.java:128)\n\tat org.elasticsearch.server@8.11.0/org.elasticsearch.common.component.AbstractLifecycleComponent.stop(AbstractLifecycleComponent.java:73)\n\tat org.elasticsearch.server@8.11.0/org.elasticsearch.node.Node.lambda$prepareForClose$59(Node.java:1768)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)\n\t... 1 more\n"}
elasticsearch-node3           | {"@timestamp":"2023-11-22T22:35:58.336Z", "log.level": "INFO", "message":"stopping ...", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"Thread-0","log.logger":"org.elasticsearch.node.Node","elasticsearch.node.name":"node3","elasticsearch.cluster.name":"mycluster"}
elasticsearch-node1           | {"@timestamp":"2023-11-22T22:35:58.337Z", "log.level": "INFO", "message":"stopping ...", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"Thread-0","log.logger":"org.elasticsearch.node.Node","elasticsearch.node.name":"node1","elasticsearch.cluster.name":"mycluster"}
elasticsearch-node3           | {"@timestamp":"2023-11-22T22:35:58.386Z", "log.level": "INFO", "message":"stopped", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"Thread-0","log.logger":"org.elasticsearch.node.Node","elasticsearch.node.name":"node3","elasticsearch.cluster.name":"mycluster"}
elasticsearch-node1           | {"@timestamp":"2023-11-22T22:35:58.387Z", "log.level": "INFO", "message":"stopped", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"Thread-0","log.logger":"org.elasticsearch.node.Node","elasticsearch.node.name":"node1","elasticsearch.cluster.name":"mycluster"}

```

### Steps to Reproduce

I have this in docker-compose:

```yaml
  elasticsearch-node1:
    image: "docker.elastic.co/elasticsearch/elasticsearch:8.11.0"
    container_name: elasticsearch-node1
    ulimits:
      memlock:
        soft: -1
        hard: -1
    environment:
      - cluster.name=mycluster
      - node.name=node1
      - action.auto_create_index=true
      - cluster.initial_master_nodes=node1  # Add node3
    ports:
      - "9201:9200"
```

### Logs (if relevant)

_No response_
server/src/main/java/org/elasticsearch/node/Node.java
+ "], already added in plugin ["
                            + oldPlugin
                            + "]"
                    );
                }
            }
            builder.put(settings);
        }
        return builder.put(originalSettings).build();
    }
    static class LocalNodeFactory implements Function<BoundTransportAddress, DiscoveryNode> {
        private final SetOnce<DiscoveryNode> localNode = new SetOnce<>();
        private final String persistentNodeId;
        private final Settings settings;
        LocalNodeFactory(Settings settings, String persistentNodeId) {
            this.persistentNodeId = persistentNodeId;
            this.settings = settings;
        }
        @Override
        public DiscoveryNode apply(BoundTransportAddress boundTransportAddress) {
            localNode.set(DiscoveryNode.createLocal(settings, boundTransportAddress.publishAddress(), persistentNodeId));
            return localNode.get();
        }
        DiscoveryNode getNode() {
            assert localNode.get() != null;
            return localNode.get();
        }
    }
}