MongoDB Shard Server
What is Port 27018?
Port 27018 is the default port for MongoDB shard servers (mongod instances running with --shardsvr flag). In a sharded MongoDB cluster, data is distributed across multiple shard servers, each holding a subset of the data. When MongoDB is configured for sharding, the shard server instances listen on port 27018 instead of the default 27017. Sharding enables MongoDB to scale horizontally across multiple machines, handling datasets and query volumes that exceed the capacity of a single server. The mongos router process connects to shard servers on port 27018 to route queries to the appropriate shards.
Common Uses
- MongoDB sharded cluster shard instances
- Horizontal data distribution
- Large-scale MongoDB deployments
- High-throughput database operations
Technical Details
Copy-paste commands to check port 27018 (MongoDB Shard Server) from your terminal
Test connectivity
nc -zv example.com 27018
curl -v --max-time 5 http://example.com:27018/
telnet example.com 27018
nmap -p 27018 -sV example.com
(echo > /dev/tcp/example.com/27018) 2>/dev/null && echo "open" || echo "closed"
Open port in firewall
sudo ufw allow 27018/tcp
sudo iptables -A INPUT -p tcp --dport 27018 -j ACCEPT
sudo firewall-cmd --permanent --add-port=27018/tcp && sudo firewall-cmd --reload
Security Considerations
Apply the same security measures as port 27017. Enable authentication and TLS. Restrict access to mongos routers and config servers only. Implement keyFile or x.509 authentication for internal cluster communication. Monitor for unauthorized access to shard data.
Popular Ports Reference
The most commonly used and referenced network ports