Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
majguo committed Aug 19, 2020
1 parent ec4d52f commit bff5f40
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 8 deletions.
12 changes: 8 additions & 4 deletions guides/howto-deploy-java-openliberty-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Follow the instructions in these two tutorials and then return here to continue.
> Though the "Get a Red Hat pull secret" step is labeled as optional, **it is required for this article**. The pull secret enables your Azure Red Hat OpenShift cluster to find the Open Liberty Operator.
>
> If you plan to run memory-intensive applications on the cluster, specify the proper virtual machine size for the worker nodes using the `--worker-vm-size` parameter. For example, `Standard_E4s_v3` is the minimum virtual machine size to install the Elasticsearch Operator on a cluster. Refer to the following for further details:
>
> * [Azure CLI to create a cluster](https://docs.microsoft.com/cli/azure/aro?view=azure-cli-latest#az-aro-create)
> * [Supported virtual machine sizes for memory optimized](/azure/openshift/support-policies-v4#memory-optimized)
> * [Prerequisites to install the Elasticsearch Operator](https://docs.openshift.com/container-platform/4.3/logging/cluster-logging-deploying.html#cluster-logging-deploy-eo-cli_cluster-logging-deploying)
Expand Down Expand Up @@ -131,7 +132,7 @@ To run the application on Open Liberty, you need to create an Open Liberty serve

7. Open [http://localhost:9080/](http://localhost:9080/) in your browser to visit the application home page. The application will look similar to the following:
![javaee-cafe-web-ui](./media/howto-deploy-java-openliberty-app/javaee-cafe-web-ui.png)
8. Press **Control-C** to stop the application and Open Liberty server.
8. Press **Control-C** to stop the application and Open Liberty server.

The directory `2-simple` of your local clone shows the Maven project with the above changes already applied.

Expand All @@ -141,18 +142,20 @@ To deploy and run your Liberty application on an ARO 4 cluster, containerize you

### Build application image

Complete the following steps to build the application image:
Complete the following steps to build the application image:

1. Change directory to `2-simple` of your local clone.
2. Run `mvn clean package` to package the application.
3. Run one of the following commands to build the application image.
* Build with Open Liberty base image:

```bash
# Build and tag application image. This will cause Docker to pull the necessary Open Liberty base images.
docker build -t javaee-cafe-simple:1.0.0 --pull .
```

* Build with WebSphere Liberty base image:

```bash
# Build and tag application image. This will cause Docker to pull the necessary WebSphere Liberty base images.
docker build -t javaee-cafe-simple:1.0.0 --pull --file=Dockerfile-wlp .
Expand Down Expand Up @@ -260,7 +263,7 @@ Instead of using the web console GUI, you can deploy the application from the co
oc get openlibertyapplication
NAME IMAGE EXPOSED RECONCILED AGE
javaee-cafe-simple docker.io/<docker_account>/javaee-cafe-simple:1.0.0 true True 36s
javaee-cafe-simple <Container_Registry_URL>/javaee-cafe-simple:1.0.0 true True 36s
# Check if deployment created by Operator is ready
oc get deployment
Expand All @@ -286,6 +289,7 @@ Instead of using the web console GUI, you can deploy the application from the co

In this guide, you learned how to:
> [!div class="checklist"]
>
> * Prepare the Liberty application
> * Build the application image
> * Run the containerized application on an ARO 4 cluster using the GUI and the CLI.
Expand Down
7 changes: 6 additions & 1 deletion guides/howto-integrate-aad-oidc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

In this guide, you will integrate your Open Liberty application with Azure Active Directory OpenID Connect for security. The Open Liberty application is running on an Azure Red Hat OpenShift (ARO) 4 cluster. You learn how to:
> [!div class="checklist"]
>
> * Set up Azure Active Directory
> * Prepare your application
> * Prepare application image
Expand Down Expand Up @@ -93,7 +94,9 @@ docker push ${Container_Registry_URL}/javaee-cafe-aad-oidc:1.0.0
```

> [!NOTE]
> Replace **${Container_Registry_URL}** with the fully qualified name of your ACR instance.
>
> * Replace **${Container_Registry_URL}** with the fully qualified name of your ACR instance.
> * Replace **${Registry_Name}** with the name of your ACR instance.
After the application image is built, run with your local Docker to verify whether it works.

Expand Down Expand Up @@ -166,6 +169,7 @@ oc get route
```

> [!NOTE]
>
> * Refer to [Set up Azure Red Hat OpenShift cluster](howto-deploy-java-openliberty-app.md#set-up-azure-red-hat-openshift-cluster) on how to connect to the cluster.
> * **open-liberty-demo** is already created in the [previous guide](howto-deploy-java-openliberty-app.md).
> * Replace **\<client ID>**, **\<client secret>**, **\<tenant ID>**, and **\<group ID>** with the ones you noted down before.
Expand All @@ -180,6 +184,7 @@ Once the Open Liberty Application is up and running, copy **HOST/PORT** of the r

In this guide, you learned how to:
> [!div class="checklist"]
>
> * Set up Azure Active Directory
> * Prepare your application
> * Prepare application image
Expand Down
7 changes: 6 additions & 1 deletion guides/howto-integrate-all.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

In this guide, you will integrate your Open Liberty application with different Azure services, including security, data persistence & distributed logging. The Open Liberty application is running on an Azure Red Hat OpenShift (ARO) 4 cluster. You learn how to:
> [!div class="checklist"]
>
> * Set up different services
> * Prepare your application
> * Prepare application image
Expand Down Expand Up @@ -78,7 +79,9 @@ The `Dockerfile` located at [`<path-to-repo>/4-finish/Dockerfile`](https://githu
```

> [!NOTE]
> Replace **${Container_Registry_URL}** with the fully qualified name of your ACR instance.
>
> * Replace **${Container_Registry_URL}** with the fully qualified name of your ACR instance.
> * Replace **${Registry_Name}** with the name of your ACR instance.
## Deploy sample application

Expand Down Expand Up @@ -153,6 +156,7 @@ oc get route
```

> [!NOTE]
>
> * Refer to [Set up Azure Red Hat OpenShift cluster](howto-deploy-java-openliberty-app.md#set-up-azure-red-hat-openshift-cluster) on how to connect to the cluster.
> * **open-liberty-demo** is already created in the [previous guide](howto-deploy-java-openliberty-app.md).
> * Replace **\<client ID>**, **\<client secret>**, **\<tenant ID>**, and **\<group ID>** with the ones you noted down before.
Expand Down Expand Up @@ -185,6 +189,7 @@ The application logs are shipped to the Elasticsearch cluster, and can be visual

In this guide, you learned how to:
> [!div class="checklist"]
>
> * Set up different services
> * Prepare your application
> * Prepare application image
Expand Down
23 changes: 21 additions & 2 deletions guides/howto-integrate-azure-managed-databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[Azure managed databases](https://azure.microsoft.com/product-categories/databases/) are managed, intelligent, and flexible cloud database services offered by Microsoft Azure. In this guide, you will integrate your Open Liberty application with Azure managed databases to enable data persistence. The Open Liberty application is running on an Azure Red Hat OpenShift (ARO) 4 cluster. You learn how to:
> [!div class="checklist"]
>
> * Connect your application to Azure SQL Database
> * Connect your application to Azure Database for PostgreSQL
Expand All @@ -19,9 +20,11 @@ Follow the instructions below to set up an Azure SQL Database single database fo

1. Create a single database in Azure SQL Database by following "[Quickstart: Create an Azure SQL Database single database](https://docs.microsoft.com/azure/azure-sql/database/single-database-create-quickstart)".
> [!NOTE]
>
> * In configuring **Basics** step, write down **Database name**, ***Server name**.database.windows.net*, **Server admin login** and **Password**.
> * In configuring **Networking** step, set **Allow Azure services and resources to access this server** to **Yes**. It will allow access from your Open Liberty application running on ARO 4 cluster to this database server.
> ![create-sql-database-networking](./media/howto-integrate-azure-managed-databases/create-sql-database-networking.png)
2. Once your database is created, open **your SQL server** > **Firewalls and virtual networks** > Set **Minimal TLS Version** to **>1.0** > Click **Save**.
![sql-database-minimum-TLS-version](./media/howto-integrate-azure-managed-databases/sql-database-minimum-TLS-version.png)
3. Open **your SQL database** > **Connection strings** > Select **JDBC**. Write down the **Port number** following sql server address. For example, **1433** is the port number in the example below.
Expand Down Expand Up @@ -262,6 +265,7 @@ The application `<path-to-repo>/2-simple` used in the [previous guide](howto-dep
```

> [!NOTE]
>
> * **Database name**, **Server name**, **Server admin login**, **Password** and **Port number** are properties you wrote down in previous step "[Create an Azure SQL Database single database](#create-an-azure-sql-database-single-database)".
> * [Create a firewall rule](https://docs.microsoft.com/azure/azure-sql/database/firewall-create-server-level-portal-quickstart) for IP address of your client if you encountered the similar error below. Then re-run the application.
> * [ERROR ] CWWJP9992E: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.7.v20200504-69f2c2b80d): org.eclipse.persistence.exceptions.DatabaseExceptionInternal Exception: java.sql.SQLException: Cannot open server 'xxxxxxx' requested by the login. Client with IP address 'xxx.xxx.xxx.xx' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect. ClientConnectionId:xxxx-xxxx-xxxx-xxxx-xxxx: SQL State = S0001, Error Code = 40,615
Expand Down Expand Up @@ -312,14 +316,17 @@ RUN configure.sh
```

> [!NOTE]
> Replace **${Container_Registry_URL}** with the fully qualified name of your ACR instance.
>
> * Replace **${Container_Registry_URL}** with the fully qualified name of your ACR instance.
> * Replace **${Registry_Name}** with the name of your ACR instance.
### Run the application with Docker

Before deploying the containerized application to a remote cluster, run with your local Docker to verify whether it works.

1. Run `docker run -it --rm -p 9080:9080 -e DB_SERVER_NAME=<Server name>.database.windows.net -e DB_PORT_NUMBER=<Port number> -e DB_NAME=<Database name> -e DB_USER=<Server admin login>@<Server name> -e DB_PASSWORD=<Password> javaee-cafe-connect-db-mssql:1.0.0` in your console.
> [!NOTE]
>
> * **Database name**, **Server name**, **Server admin login**, **Password** and **Port number** are properties you wrote down in previous step "[Create an Azure SQL Database single database](#create-an-azure-sql-database-single-database)".
> * [Create a firewall rule](https://docs.microsoft.com/azure/azure-sql/database/firewall-create-server-level-portal-quickstart) for IP address of your client if you encountered the similar error below. Then re-run the application.
> * [ERROR ] CWWJP9992E: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.7.v20200504-69f2c2b80d): org.eclipse.persistence.exceptions.DatabaseExceptionInternal Exception: java.sql.SQLException: Cannot open server 'xxxxxxx' requested by the login. Client with IP address 'xxx.xxx.xxx.xx' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect. ClientConnectionId:xxxx-xxxx-xxxx-xxxx-xxxx DSRA0010E: SQL State = S0001, Error Code = 40,615
Expand Down Expand Up @@ -353,6 +360,7 @@ stringData:
```
> [!NOTE]
>
> * Replace **${DB_Type}** with **mssql**.
> * Replace **${DB_SERVER_NAME}** with ***Server name**.database.windows.net* you wrote down before.
> * Replace **${DB_PORT_NUMBER}** with **Port number** you wrote down before.
Expand All @@ -368,6 +376,7 @@ stringData:
````
> [!NOTE]
>
> * Refer to [Set up Azure Red Hat OpenShift cluster](howto-deploy-java-openliberty-app.md#set-up-azure-red-hat-openshift-cluster) on how to connect to the cluster.
> * **open-liberty-demo** is already created in the [previous guide](howto-deploy-java-openliberty-app.md).
Expand Down Expand Up @@ -428,6 +437,7 @@ spec:
```

> [!NOTE]
>
> * Replace **${DB_Type}** with **mssql**.
> * Replace **${Container_Registry_URL}** with the fully qualified name of your ACR instance.
> * Replace **${Image_Name}** with **javaee-cafe-connect-db-mssql**.
Expand Down Expand Up @@ -563,6 +573,7 @@ The application `<path-to-repo>/2-simple` used in the [previous guide](howto-dep
```

> [!NOTE]
>
> * **Server name**, **Port number**, **Admin username** and **Password** are properties you wrote down in previous step "[Create an Azure Database for PostgreSQL server](#create-an-azure-database-for-postgresql-server)".
> * [Create a firewall rule](https://docs.microsoft.com/azure/postgresql/howto-manage-firewall-using-portal) for IP address of your client if you encountered the similar error below. Then re-run the application.
> * [ERROR ] CWWJP9992E: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.7.v20200504-69f2c2b80d): org.eclipse.persistence.exceptions.DatabaseException. Internal Exception: java.sql.SQLException: FATAL: no pg_hba.conf entry for host "xxx.xxx.xxx.xxx", user "xxxxxx", database "xxxxxx", SSL on DSRA0010E: SQL State = 28000, Error Code = 0
Expand Down Expand Up @@ -613,17 +624,21 @@ RUN configure.sh
```

> [!NOTE]
> Replace **${Container_Registry_URL}** with the fully qualified name of your ACR instance.
>
> * Replace **${Container_Registry_URL}** with the fully qualified name of your ACR instance.
> * Replace **${Registry_Name}** with the name of your ACR instance.

### Run the application with Docker (PostgreSQL)

Before deploying the containerized application to a remote cluster, run with your local Docker to verify whether it works.

1. Run `docker run -it --rm -p 9080:9080 -e DB_SERVER_NAME=<Server name>.postgres.database.azure.com -e DB_PORT_NUMBER=<Port number> -e DB_NAME=postgres -e DB_USER=<Admin username>@<Server name> -e DB_PASSWORD=<Password> javaee-cafe-connect-db-postgres:1.0.0` in your console.
> [!NOTE]
>
> * **Server name**, **Port number**, **Admin username** and **Password** are properties you wrote down in previous step "[Create an Azure Database for PostgreSQL server](#create-an-azure-database-for-postgresql-server)".
> * [Create a firewall rule](https://docs.microsoft.com/azure/postgresql/howto-manage-firewall-using-portal) for IP address of your client if you encountered the similar error below. Then re-run the application.
> * [ERROR ] CWWJP9992E: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.7.v20200504-69f2c2b80d): org.eclipse.persistence.exceptions.DatabaseException. Internal Exception: java.sql.SQLException: FATAL: no pg_hba.conf entry for host "xxx.xxx.xxx.xxx", user "xxxxxx", database "xxxxxx", SSL on DSRA0010E: SQL State = 28000, Error Code = 0

2. Wait for Open Liberty to start and the application to deploy successfully.
3. Open [http://localhost:9080/](http://localhost:9080/) in your browser to visit the application home page.
4. Press **Control-C** to stop the application and Open Liberty server.
Expand Down Expand Up @@ -653,6 +668,7 @@ stringData:
```

> [!NOTE]
>
> * Replace **${DB_Type}** with **postgres**.
> * Replace **${DB_SERVER_NAME}** with ***<Server name>**.postgres.database.azure.com* you wrote down before.
> * Replace **${DB_PORT_NUMBER}** with **Port number** you wrote down before.
Expand All @@ -668,6 +684,7 @@ stringData:
````
> [!NOTE]
>
> * Refer to [Set up Azure Red Hat OpenShift cluster](howto-deploy-java-openliberty-app.md#set-up-azure-red-hat-openshift-cluster) on how to connect to the cluster.
> * **open-liberty-demo** is already created in the [previous guide](howto-deploy-java-openliberty-app.md).
Expand Down Expand Up @@ -728,6 +745,7 @@ spec:
```

> [!NOTE]
>
> * Replace **${DB_Type}** with **postgres**.
> * Replace **${Container_Registry_URL}** with the fully qualified name of your ACR instance.
> * Replace **${Image_Name}** with **javaee-cafe-connect-db-postgres**.
Expand Down Expand Up @@ -756,6 +774,7 @@ For reference, you can find these deployment files from `<path-to-repo>/3-integr

In this guide, you learned how to:
> [!div class="checklist"]
>
> * Connect your application to Azure SQL Database
> * Connect your application to Azure Database for PostgreSQL

Expand Down
6 changes: 6 additions & 0 deletions guides/howto-integrate-elasticsearch-stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

In this guide, you will integrate your Open Liberty application with Elasticsearch stack to enable distributed logging. The Open Liberty application is running on an Azure Red Hat OpenShift (ARO) 4 cluster. You learn how to:
> [!div class="checklist"]
>
> * Distribute your application logs to hosted Elasticsearch on Microsoft Azure
> * Distribute your application logs to EFK stack installed on ARO 4 cluster
Expand Down Expand Up @@ -52,6 +53,7 @@ metadata:
````
> [!NOTE]
>
> * Refer to [Set up Azure Red Hat OpenShift cluster](howto-deploy-java-openliberty-app.md#set-up-azure-red-hat-openshift-cluster) on how to connect to the cluster.
> * **open-liberty-demo** is already created in the [previous guide](howto-deploy-java-openliberty-app.md).
Expand Down Expand Up @@ -111,6 +113,7 @@ stringData:
```

> [!NOTE]
>
> * Replace **${ELASTIC_CLOUD_ID}** with **Cloud ID** you wrote down before.
> * Replace **${ELASTIC_CLOUD_AUTH}** with **User name:Password** you wrote down before.

Expand Down Expand Up @@ -184,6 +187,7 @@ spec:
```

> [!NOTE]
>
> * Replace **${Container_Registry_URL}** with the fully qualified name of your ACR instance.
> * Image `javaee-cafe-simple` is built from [previous guide](howto-deploy-java-openliberty-app.md#build-application-image).

Expand Down Expand Up @@ -281,6 +285,7 @@ spec:
```

> [!NOTE]
>
> * Replace **${Container_Registry_URL}** with the fully qualified name of your ACR instance.
> * Image `javaee-cafe-simple` is built from [previous guide](howto-deploy-java-openliberty-app.md#build-application-image).

Expand Down Expand Up @@ -325,6 +330,7 @@ As long as the application logs are shipped to the Elasticsearch cluster, they c

In this guide, you learned how to:
> [!div class="checklist"]
>
> * Distribute your application logs to hosted Elasticsearch on Microsoft Azure
> * Distribute your application logs to EFK stack installed on ARO 4 cluster

Expand Down

0 comments on commit bff5f40

Please sign in to comment.