Skip to content

Commit

Permalink
Merge pull request #48 from apache/correct-mysql-usage-desc
Browse files Browse the repository at this point in the history
[AMORO-3404] Correct the description about MySQL usage
  • Loading branch information
zhoujinsong authored Jan 22, 2025
2 parents 0f7d83d + b17f949 commit 3351936
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 36 deletions.
14 changes: 7 additions & 7 deletions amoro-docs/content/admin-guides/deployment-on-kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,17 @@ ingress:
### Configure the database.
AMS default is to use Derby database for storage. When the pod is destroyed, the data will also disappear.
In production environments, we recommend using MySQL as the storage for system data.
AMS uses embedded [Apache Derby](https://db.apache.org/derby/) as its backend storage by default.
In production environments, we recommend using a RDBMS(Relational Database Management System) with higher availability guarantees as the storage for system data, you can ref to [Database Configuration](/deployment/#configure-system-database) for more detail.
```yaml
amoroConf:
database:
type: mysql
driver: com.mysql.cj.jdbc.Driver
url: <jdbc-uri>
username: <mysql-user>
password: <mysql-password>
type: ${your_database_type}
driver: ${your_database_driver}
url: ${your_jdbc_url}
username: ${your_username}
password: ${your_password}
```
Expand Down
42 changes: 14 additions & 28 deletions amoro-docs/content/admin-guides/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ You can choose to download the stable release package from [download page](../..
## System requirements

- Java 8 is required.
- Optional: MySQL 5.5 or higher
- Optional: PostgreSQL 14.x or higher
- Optional: A RDBMS (PostgreSQL 14.x or higher, MySQL 5.5 or higher)
- Optional: ZooKeeper 3.4.x or higher

## Download the distribution
Expand Down Expand Up @@ -99,38 +98,25 @@ Make sure the port is not used before configuring it.
### Configure system database
You can use MySQL/PostgreSQL as the system database instead of the default Derby.
AMS uses embedded [Apache Derby](https://db.apache.org/derby/) as the backend storage by default, so you can use `Derby` directly without any additional configuration.

If you would like to use MySQL as the system database, you need to manually download the [MySQL JDBC Connector](https://repo1.maven.org/maven2/com/mysql/mysql-connector-j/8.1.0/mysql-connector-j-8.1.0.jar)
and move it into the `{AMORO_HOME}/lib/` directory. You can use the following command to complete these operations:
```shell
$ cd ${AMORO_HOME}
$ MYSQL_JDBC_DRIVER_VERSION=8.0.30
$ wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/${MYSQL_JDBC_DRIVER_VERSION}/mysql-connector-java-${MYSQL_JDBC_DRIVER_VERSION}.jar
$ mv mysql-connector-java-${MYSQL_JDBC_DRIVER_VERSION}.jar lib
```
You can also configure a relational backend storage as you needed.

> If you would like to use MySQL as the system database, you need to manually download the [MySQL JDBC Connector](https://repo1.maven.org/maven2/com/mysql/mysql-connector-j/8.1.0/mysql-connector-j-8.1.0.jar)
and move it into the `${AMORO_HOME}/lib/` directory.

Create an empty database in MySQL/PostgreSQL, then AMS will automatically create tables in this MySQL/PostgreSQL database when it first started.
You need to create an empty database in the RDBMS before to start the server, then AMS will automatically create tables in the database when it first started.

One thing you need to do is Adding MySQL/PostgreSQL configuration under `config.yaml` of Ams:
One thing you need to do is adding configuration under `config.yaml` of Ams:

```yaml
# MySQL
ams:
database:
type: mysql
jdbc-driver-class: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/amoro?useUnicode=true&characterEncoding=UTF8&autoReconnect=true&useAffectedRows=true&allowPublicKeyRetrieval=true&useSSL=false
username: root
password: root
# PostgreSQL
#ams:
# database:
# type: postgres
# jdbc-driver-class: org.postgresql.Driver
# url: jdbc:postgresql://127.0.0.1:5432/amoro
# username: user
# password: passwd
type: ${database_type} # postgres or mysql
jdbc-driver-class: ${your_driver_name}
url: ${your_jdbc_url}
username: ${your_username}
password: ${your_password}
```

### Configure high availability
Expand Down Expand Up @@ -296,7 +282,7 @@ $ bin/ams.sh stop

### Upgrade system databases

You can find all the upgrade SQL scripts under `{AMORO_HOME}/conf/mysql/` with name pattern `upgrade-a.b.c-to-x.y.z.sql`.
You can find all the upgrade SQL scripts under `${AMORO_HOME}/conf/${db_type}/` with name pattern `upgrade-a.b.c-to-x.y.z.sql`.
Execute the upgrade SQL scripts one by one to your system database based on your starting and target versions.

### Replace all libs and plugins
Expand Down
2 changes: 1 addition & 1 deletion amoro-docs/content/concepts/catalogs.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ the multi-catalog feature can be used to support SQL across data sources, such a

```SQL
SELECT c.ID, c.NAME, c.AGE, o.AMOUNT
FROM MYSQL.ONLINE.CUSTOMERS c JOIN HIVE.OFFLINE.ORDERS o
FROM ${CATALOG_A}.ONLINE.CUSTOMERS c JOIN ${CATALOG_B}.OFFLINE.ORDERS o
ON (c.ID = o.CUSTOMER_ID)
```

Expand Down

0 comments on commit 3351936

Please sign in to comment.