Backend Development 8 min read

Optimizing a Low‑End Laptop for Spring Cloud Microservices with ZeroTier

This guide explains how to configure a modest‑spec laptop (e.g., 8 GB RAM) for Spring Cloud microservice development, optimize IDE memory settings, offload services to an Alibaba Cloud ECS instance, and establish seamless networking and service discovery using ZeroTier, including optional Moon satellite deployment.

Java Architecture Diary
Java Architecture Diary
Java Architecture Diary
Optimizing a Low‑End Laptop for Spring Cloud Microservices with ZeroTier

Background

A student asked whether a gaming laptop bought during university can be used for developing Spring Cloud microservices. It can, but you will suffer unless the memory is at least

16G

. Running ten microservices locally on a low‑spec machine will essentially freeze.

I share how I optimize my 17" MBP i5 with 8 GB RAM for local development together with a remote Alibaba Cloud ECS, planning to use it for the next five years.

Application memory configuration optimization

Set IDEA VM options: VM options: -Xms128m -Xmx256m

This size is enough for simple local development, but it does not solve scenarios where IDEA, webstore, DB and other tools run simultaneously; memory remains insufficient.

Application componentized deployment

Solution: keep only the service modules required by the currently open application locally; deploy other business modules to cloud servers.

Problem: because the local machine has no public IP, it can only call services on the ECS; the gateway or other services on the ECS cannot access services on the local development machine.

How to achieve networking between local and ECS and ensure normal service registration and gateway forwarding?

We can use VPN or other technologies to network the local and cloud servers, enable mutual communication, and assign the service center’s network card for proper registration. Since building a VPN is costly and complex, this article demonstrates how to use ZeroTier.

Initialize ECS

Purchase ECS

Alibaba Cloud ECS official site

Recommend 8 GB memory; install database/Redis on the cloud. Image: centos7

Configure security group, expose necessary service ports

Initialize CentOS7

<code>curl -O http://pigx.vip/os7init.sh

sh os7init.sh pig4cloud
</code>

Install ZeroTier

Both local and cloud servers need to install the client

<code>curl -s https://install.zerotier.com | sudo bash
</code>

Other operating systems

Download address: https://www.zerotier.com/download/

Deploy ZeroTier networking

Basic concept

ZeroTier is a smart Ethernet switch for planet Earth.

Translation: a smart Ethernet switch for the Earth.

In plain terms it is Peer to Peer (P2P); ZeroTier root servers record request paths for DNS‑like resolution. Its main function is to connect devices from different networks as if they were on the same LAN.

ZeroTier configures a virtual network

172.17.2.0/24

; joining this network at home allows access to the company address

172.17.2.101

.

Terminology

ZeroTier defines several terms:

PLANET – root server

MOON – satellite server, user‑built private root server for proxy acceleration

LEAF – network client, each connected node

1. Register ZeroTier service

https://my.zerotier.com/

2. Create network

4. Client joins created network

<code>zerotier-cli join a0cbf4b62af33545 # network ID from previous step

Output 200 join OK
</code>

ZeroTier approve client access

Click the created network, go to network details, approve client

The client receives a LAN IP

172.28.153.245

; the subnet can be adjusted via the Advanced page.

Similarly, other devices can join this network.

Confirm network connectivity

Network is up...

Spring Cloud configuration

Adjust client ZeroTier registered IP

Configure services running on ECS to use service discovery IP

Configure services running locally to use service discovery IP

Service startup

Access the registry, view the network list, ensure each service registers with a ZeroTier virtual IP and can communicate.

【Extension】Deploy MOON satellite

Configure moon service

<code>cd /var/lib/zerotier-one/

zerotier-idtool initmoon identity.public > moon.json

vim moon.json

zerotier-idtool genmoon moon.json

# This ID is crucial, corresponds to the unique service ID (also visible in the ZeroTier console)
grep id /var/lib/zerotier-one/moon.json | head -n 1
</code>

Client connects to moon

Follow these steps; executing only orbit may fail

<code>mkdir /var/lib/zerotier-one/moons.d

cp 000000XXX moons.d/

systemctl restart zerotier-one

grep id /var/lib/zerotier-one/moon.json | head -n 1

zerotier-cli orbit id id

zerotier-cli listpeers
</code>
MicroservicesDevOpsNetwork OptimizationSpring CloudAlibaba CloudZeroTier
Java Architecture Diary
Written by

Java Architecture Diary

Committed to sharing original, high‑quality technical articles; no fluff or promotional content.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.