Apache ShenYu
Overview
Apache ShenYu is a high-performance, reactive API gateway built for microservices. It provides dynamic traffic routing, load balancing, authentication, rate limiting, circuit breaking and observability through a rich plugin model. You configure it all at runtime from a web admin console, with no gateway restarts.
This image installs Apache ShenYu 2.6.1 as two systemd services on Eclipse Temurin / OpenJDK 17. shenyu-admin is the control-plane console and REST API, and shenyu-bootstrap is the data-plane gateway. It rotates the default admin password to a unique value on the first boot of every VM.
What you get:
- Apache ShenYu 2.6.1:
shenyu-admin(console and REST API on loopback127.0.0.1:9095) andshenyu-bootstrap(gateway on loopback127.0.0.1:9195) - A local MySQL 8 database seeded with the ShenYu schema, with its datadir on a dedicated Azure data disk at
/var/lib/shenyu - nginx on
:80as a reverse proxy to the admin console, with WebSocket upgrade for the admin and gateway config sync - A unique admin password generated on first boot, rotated from the Apache default and written to a root-only credentials file
mysql.service,shenyu-admin.service,shenyu-bootstrap.serviceandnginx.serviceas systemd units, enabled and active- 24/7 SecureAnyCloud support
Prerequisites
- An active Azure subscription.
- An SSH key pair.
- A VNet and subnet in the target region.
- Standard_B2ms (2 vCPU / 8 GiB RAM) is a good starting size.
- NSG inbound rules that allow
22/tcpfrom your management network and80/tcpfor the admin console.
Step 1 - Deploy from the Azure Marketplace
Sign in to the Azure Portal, choose Create a resource, and search the Marketplace for Apache ShenYu by SecureAnyCloud. Select Create.
On the Basics tab, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) and HTTP (80).
Review the dedicated data disk on the Disks tab, then choose Review + create and Create.
Step 2 - Deploy from the Azure CLI
Alternatively, create the VM with the Azure CLI:
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:apache-shenyu-ubuntu-24-04:default:latest
az vm create \
--resource-group <your-rg> \
--name shenyu \
--image sac1647283583153:apache-shenyu-ubuntu-24-04:default:latest \
--size Standard_B2ms \
--admin-username azureuser \
--ssh-key-values ~/.ssh/id_ed25519.pub \
--vnet-name <your-vnet> --subnet <your-subnet> \
--public-ip-sku Standard
az vm open-port --resource-group <your-rg> --name shenyu --port 80 --priority 1010Step 3 - Connect to your VM
Connect over SSH with your key:
ssh azureuser@<vm-public-ip>Step 4 - Confirm the services are running
Check the four services:
systemctl is-active mysql.service shenyu-admin.service shenyu-bootstrap.service nginx.serviceAll four report active. The admin console (9095) and the gateway (9195) are bound to loopback. Only nginx on :80 is exposed.
The MySQL datadir and ShenYu logs live on the dedicated data disk mounted at /var/lib/shenyu.
Step 5 - Retrieve your admin password
On first boot, ShenYu rotates the default admin/123456 login to a password unique to your VM. It writes the new password to a root-only file:
sudo cat /root/shenyu-credentials.txtThis file contains SHENYU_ADMIN_USER (admin) and SHENYU_ADMIN_PASSWORD. Store the password somewhere safe.
Step 6 - Confirm the health endpoint
nginx serves an unauthenticated health endpoint for load balancers and probes. Request it:
curl -s http://localhost/healthThe endpoint returns ok.
Step 7 - Verify authentication from the command line
ShenYu's admin login API rejects the old default password and accepts the per-VM admin password. A successful login returns a session token:
PW=$(sudo grep '^SHENYU_ADMIN_PASSWORD=' /root/shenyu-credentials.txt | cut -d= -f2-); curl -s -G 'http://localhost/platform/login' --data-urlencode 'userName=admin' --data-urlencode "password=$PW" | head -c 120; echoThe response contains a "token" field. The default 123456 password no longer works, because it was rotated away on first boot.
Step 8 - Confirm the components and plugin catalogue
ShenYu ships with a large plugin catalog, including proxy, authentication, rate limiting, circuit breaking and observability plugins. You can enable them at runtime. Check the components and the catalog:
ls -d /opt/shenyu/admin /opt/shenyu/bootstrap; java -version 2>&1 | head -1; curl -s -o /dev/null -w 'gateway actuator: HTTP %{http_code}\n' http://localhost:9195/actuator/healthThe admin and bootstrap components are under /opt/shenyu and run on OpenJDK 17. The data-plane gateway answers its health probe with 200.
Step 9 - Sign in to the admin console
Browse to http://<vm-public-ip>/ and sign in as admin with the password from Step 5. The login form shows a verification code that you type to submit.
The console lists every plugin grouped by category: Proxy, Authentication, FaultTolerance, HttpProcess, Cryptor, Logging and more. Select a plugin, for example the Divide HTTP proxy plugin, to see its selectors and rules.
Step 10 - Configure selectors and rules
Each plugin routes traffic with selectors (which upstreams match) and rules (how matched traffic is handled).
Click Add on the selector panel to open the selector configuration form. Set the match conditions (URI path patterns, headers, query parameters), the selector type and the order, then add rules underneath it.
Changes are pushed to the gateway over the admin and gateway sync channel with no restart.
Step 11 - Manage console users
Under System Manage -> User, you can manage dashboard users, roles and resource permissions for the admin console itself. The admin account is the per-VM administrator whose password you retrieved in Step 5.
Step 12 - Confirm state lives on the dedicated disk
The MySQL database (plugin, selector and rule configuration) and the ShenYu logs are stored on the dedicated Azure data disk. They survive OS changes, and you can resize the disk independently. Check the mount:
findmnt /var/lib/shenyuThe mount is backed by a separate Azure data disk captured into the image and re-provisioned on every VM.
Routing traffic through the gateway
The data-plane gateway listens on 127.0.0.1:9195 inside the VM. For production, front it with your own ingress and TLS termination, or expose it on a dedicated NSG rule and load balancer.
Register your upstream services as selectors under the relevant proxy plugin (Divide for HTTP, SpringCloud, Dubbo, gRPC, and so on). The admin console pushes configuration changes to the gateway live.
Maintenance
- Configuration: all plugin, selector and rule state is in the MySQL
shenyudatabase on/var/lib/shenyu. Back it up by snapshotting the data disk. - Admin password: change it from System Manage -> User -> Edit, or via the admin REST API.
- Logs: ShenYu admin and bootstrap logs are under
/var/lib/shenyu/logs. - Restarts:
sudo systemctl restart shenyu-adminorsudo systemctl restart shenyu-bootstrapafter maintenance. MySQL must be up before the admin. - Security patches: unattended-upgrades remains enabled, so the OS continues to receive security updates automatically.
Support
SecureAnyCloud provides 24/7 expert support for this image. Contact sales@secureanycloud.com.
Deploy on Azure
Launch Apache ShenYu on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.
View this image
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com
Overview
Apache ShenYu is a high-performance, reactive, open-source API gateway built on Java and Spring WebFlux. It provides dynamic routing, load balancing, traffic control, rate limiting, circuit breaking, authentication and observability through a hot-pluggable plugin ecosystem. You manage all of its configuration from a graphical admin console and a REST API.
This image runs ShenYu as a set of coordinated services on a single instance, with credentials generated on the first boot of every deployed instance.
What you get:
- The shenyu-admin control plane serves the web console and REST API on the loopback interface at
127.0.0.1:9095. - The shenyu-bootstrap reactive data-plane gateway proxies your traffic and applies the configured plugins. It listens on the loopback interface at
127.0.0.1:9195. - A local MySQL 8 config store holds the durable source of truth for every selector, rule and plugin. Its data directory is on a dedicated, independently resizable EBS data volume mounted at
/var/lib/shenyu. - An nginx reverse proxy publishes the admin console on port 80 and serves an unauthenticated health endpoint.
- The admin console, the gateway data plane and MySQL all bind to the loopback interface only.
- The administrator password and the MySQL application password are generated on first boot. Two instances launched from the same Amazon Machine Image never share credentials, and the well-known ShenYu default login no longer works.
- The admin password is written to
/root/apache-shenyu-credentials.txtwith mode 0600, so only the root user can read it. - A demo route (
/sac-marker) is seeded, so the gateway proxies real traffic out of the box.
Prerequisites
Before you deploy this image, you need the following:
- An AWS account and permission to launch EC2 instances from an AWS Marketplace subscription.
- An EC2 key pair in the target region for SSH access.
- A security group that allows inbound TCP
22(SSH) from your address and inbound TCP80(the admin console via nginx) from the networks that should reach it. Restrict both to trusted CIDRs. - An instance size of
m5.largeor larger. ShenYu runs two JVM services plus MySQL, so at least 8 GB of RAM is recommended.
Connecting to your instance
Connect over SSH as the default login user for your instance's operating system variant. Use the private key of the EC2 key pair you launched the instance with.
For Ubuntu 24.04 LTS, the SSH login user is ubuntu:
ssh -i /path/to/key.pem ubuntu@<public-ip>Retrieve the admin credentials
The administrator password is generated on first boot and stored in a root-only file. Read it with sudo:
sudo cat /root/apache-shenyu-credentials.txtThe file shows the console URL, the admin user and the generated password:
SHENYU_URL=http://203.0.113.10/ SHENYU_ADMIN_USER=admin SHENYU_ADMIN_PASSWORD=<set-at-first-boot>Sign in to the admin console
Browse to http://<public-ip>/ and sign in with the user admin and the password from the credentials file. A verification code (captcha) protects the login form.
After you sign in, the dashboard shows an overview of the gateway plugins, selectors and rules, and recent activity.
The Plugin List groups the hot-pluggable gateway plugins: routing and load balancing (divide), authentication, rate limiting, fault tolerance, cryptography and more. Enable a plugin, then attach selectors and rules to route and transform traffic.
Verify the services
All four services start automatically on boot and restart on failure. Confirm that they are active:
systemctl is-active mysql shenyu-admin shenyu-bootstrap nginxactive active active activeThe unauthenticated health endpoint served by nginx returns 200:
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1/health200The gateway data plane
The reactive gateway (shenyu-bootstrap) listens on the loopback interface at 127.0.0.1:9195. The image seeds a demo route, /sac-marker, that the divide plugin proxies to a local backend. You can prove an end-to-end proxy round trip immediately:
curl -s http://127.0.0.1:9195/sac-markerSHENYU_GATEWAY_MARKER_OKThis request entered the ShenYu gateway on port 9195, matched the seeded selector and rule, and was proxied to the backend, which returned the marker.
Configuration is synced from the admin control plane to the data plane in real time. It is persisted in MySQL on the dedicated data volume, so your routes survive restarts and instance replacement.
Create your own routes
Routes in ShenYu are built from a plugin, a selector (which requests to match, and which upstreams to send them to) and one or more rules (how to transform the matched traffic). To publish your own upstream service through the gateway:
- In the admin console, open PluginList, find the divide plugin and make sure it is enabled.
- Add a selector that matches the requests you want to route (for example a URI prefix) and register your upstream host and port.
- Add a rule under that selector to apply load balancing, rate limiting, authentication or any other plugin behavior.
- Send traffic to the gateway data plane. ShenYu proxies it to your upstream.
The admin REST API is available on the loopback interface at http://127.0.0.1:9095/ for automation and infrastructure as code. The console drives the same API.
Exposing the gateway securely
By design, the only port open to the internet is the admin console on port 80. The admin REST API (127.0.0.1:9095) and the gateway data plane (127.0.0.1:9195) stay on loopback. For production traffic:
- Publish the gateway data plane behind your own ingress and TLS (for example an Application Load Balancer or an nginx TLS front end) rather than exposing
9195directly. - Keep the admin console restricted to trusted networks in your security group, and front it with TLS.
- Keep the MySQL config store and the admin REST API on the loopback interface. Do not open them.
Maintenance
- Config store: all gateway configuration lives in MySQL on the data volume mounted at
/var/lib/shenyu. Back up that volume with EBS snapshots to protect your selectors, rules and plugins. - Logs: the admin and bootstrap logs are written under
/var/lib/shenyu/logs. - Restarts:
sudo systemctl restart shenyu-admin shenyu-bootstrapreloads the services. Configuration is reloaded from MySQL and re-synced to the data plane.
Support
SecureAnyCloud publishes this image with 24/7 technical support by email and chat. We can help with deployment, selector and rule design, plugin configuration, authentication and rate limiting, the MySQL config store, the admin console, TLS and gateway tuning.
Apache ShenYu is a trademark of the Apache Software Foundation. All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
Deploy on AWS
Launch Apache ShenYu on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com