How to Compile Nacos with Oracle Support and Run It in Standalone Mode

Learn how to extend Nacos’s configuration persistence beyond Derby and MySQL by cloning the feature_multiple_datasource_support branch, compiling the source with Maven, configuring Oracle as a datasource in application.properties, and launching Nacos in standalone mode, with step‑by‑step commands and essential scripts.

Java Architecture Diary
Java Architecture Diary
Java Architecture Diary
How to Compile Nacos with Oracle Support and Run It in Standalone Mode

Currently Nacos provides configuration persistence using Derby and MySQL. In scenarios where these databases cannot be used, you need to extend support for other databases manually. Nacos previously created a branch to adapt other databases, which can be obtained by compiling the source.

Getting Source Code and Building

Clone the branch that supports multiple data sources.

git clone https://github.com/alibaba/nacos.git -b feature_multiple_datasource_support

Build the executable.

mvn -B clean package -Dmaven.test.skip=true -Prelease-nacos

After compilation, the file nacos-server-1.4.2-SNAPSHOT.zip is generated in nacos/distribution/target .

Running Nacos

Obtain the database initialization scripts; after extracting, they can be found in the conf directory.

Edit bin/application.properties to add Oracle or other datasource information.

## jpa
spring.data.jpa.repositories.enabled=true
spring.jpa.show-sql=true
## The datasource is used by oracle
spring.jpa.hibernate.naming.physical-strategy=com.alibaba.nacos.config.server.configuration.NacosPhysicalNamingStrategy
nacos.datasource.type=ORACLE
nacos.datasource.relational.dsList[0].url=jdbc:oracle:thin:@192.168.0.12:1521:XE
nacos.datasource.relational.dsList[0].username=oracle
nacos.datasource.relational.dsList[0].password=oracle
nacos.datasource.relational.dsList[0].driver-class-name=oracle.jdbc.driver.OracleDriver

Start Nacos.

./startup.sh -m standalone

Summary

The official feature_multiple_datasource_support branch is no longer maintained, meaning the multi‑datasource compatible Nacos version is 1.4.2.

Nacos 1.4.2 corresponds to Spring Cloud Alibaba 2021.1 and generally meets daily needs.

The feature_multiple_datasource_support branch is based on Spring Data JPA.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

BackendConfigurationNacosOraclespring-data-jpa
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

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.