Elasticsearch: setting up cluster with two nodes

I've set two master nodes in my cluster but it only shows "elastic-master" not "elastic-slave".(second node is not shown).How can I resolve it? I've already followed Elasticsearch documents but nothing changed!

#my host file setting:

cd /etc/elasticsearch
sudo nano hosts
192.168.143.30 elastic-master
192.168.143.23 elastic-slave

#my cluster setting:

cd /etc/elasticsearch
sudo nano elasticsearch.yml
cluster.name: “cluster1”

for "elastic-master" (192.168.143.30) setting

node.name: “elastic-master”
node.master: true
node.data: true
networkhost: 192.168.143.30
discovery.zen.ping.unicast.hosts: ["192.168.143.30","192.168.143.23"]
discovery.zen.minimum_master_nodes: 2

for "elastic-slave" (192.168.143.23) setting

node.name: “elastic-slave”
node.master: true
node.data: true
networkhost:192.168.143.23
discovery.zen.ping.unicast.hosts: ["192.168.143.30","192.168.143.23"]
discovery.zen.minimum_master_nodes: 2

What's in each node's logs? grep for zen-disco lines if there's too much information. I'm guessing a network problem prevents them from seeing each other.

Can you access each node from the other one? I.e. while ssh-ed into 192.168.143.30 can you telnet 192.168.143.23 9300 and the other way around?

Which version of Elasticsearch are you using? That configuration is no longer valid if you are using version 7.x.

# ---------------------------------- Cluster ------------------------------
cluster.name: elastic-a

# ------------------------------------ Node -------------------------------
node.name: elastic-master
node.master: true
node.data: true

# ---------------------------------- Network ------------------------------
network.host: 192.168.143.30
http.port: 9200
# --------------------------------- Discovery -----------------------------
discovery.seed_hosts: ["192.168.143.30","192.168.143.23"]
cluster.initial_master_nodes: ["elastic-slave", "elastic-master"]

I just updated my config file.
I tried telnet and it worked on both sides.

CentOS 7 ,Elasticsearch 7.5 and Kibana 7.5
Yes and I just updated my config file.

First stopped the service (sudo service elasticsearch stop). Delete the data (sudo rm -rf /var/lib/elasticsearch/*) and restart the service (sudo service elasticsearch restart). Now work all !!