Skip to content

Commit

Permalink
Merge branch 'OpenLiberty:draft' into draft
Browse files Browse the repository at this point in the history
  • Loading branch information
dearrudam authored Mar 20, 2024
2 parents a4b3606 + 1b3628a commit c443083
Show file tree
Hide file tree
Showing 131 changed files with 7,963 additions and 57 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ These steps are to be completed by the author of the blog post.

2. Clone the repo and create a branch off the default `prod` branch. From the `prod` branch, run: `git checkout -b branch_name`, where `branch_name` is a name you give your new branch.

Do _all_ your editing in this branch so that the blog editors can make any necessary edits directly in the branch before publishing your post.
Do _all_ your editing in this branch so that the blog editors can make any necessary edits directly in the branch before publishing your post. You'll push this branch directly to the shared repo (not a fork) in a later step.

3. Create your blog post using [Asciidoc](https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/) markup (use an editor such as [VSCode with the Asciidoc plugin](https://marketplace.visualstudio.com/items?itemName=joaompinto.asciidoctor-vscode)):

Expand Down
50 changes: 34 additions & 16 deletions blog_tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"blog_tags": [
{
"name": "announcements",
"posts": ["24.0.0.1",
"posts": ["24.0.0.3", "24.0.0.2",
"24.0.0.2-beta", "24.0.0.1",
"24.0.0.1-beta", "liberty-certification",
"23.0.0.12", "23.0.0.12-beta",
"23.0.0.11", "23.0.0.11-beta",
Expand Down Expand Up @@ -75,7 +76,8 @@
"featured": "true"
},{
"name": "microprofile",
"posts": ["23.0.0.12", "23.0.0.11",
"posts": ["DevNexus24", "24.0.0.2",
"23.0.0.12", "23.0.0.11",
"23.0.0.11-beta", "23.0.0.10-beta",
"liberty-ide-tools-maven-gradle-plugins-for-java-developers", "23.0.0.6",
"rapid-startup-instanton", "23.0.0.5",
Expand Down Expand Up @@ -138,7 +140,8 @@
},
{
"name": "java-se",
"posts": ["24.0.0.1", "Java21-Images",
"posts": ["24.0.0.3",
"24.0.0.1", "Java21-Images",
"23.0.0.10", "23.0.0.10-beta",
"23.0.0.3", "23.0.0.3-beta",
"22.0.0.11", "java-19-22.0.0.10-beta",
Expand All @@ -153,7 +156,8 @@
},
{
"name": "release",
"posts": ["24.0.0.1",
"posts": ["24.0.0.3", "24.0.0.2",
"24.0.0.2-beta", "24.0.0.1",
"24.0.0.1-beta", "23.0.0.12",
"23.0.0.12-beta","23.0.0.11",
"23.0.0.11-beta", "23.0.0.10",
Expand Down Expand Up @@ -208,7 +212,8 @@
},
{
"name": "beta",
"posts": ["24.0.0.1-beta", "23.0.0.12-beta",
"posts": ["24.0.0.2-beta",
"24.0.0.1-beta", "23.0.0.12-beta",
"23.0.0.11-beta", "23.0.0.10-beta",
"23.0.0.9-beta", "23.0.0.8-beta",
"23.0.0.7-beta", "23.0.0.6-beta",
Expand Down Expand Up @@ -249,7 +254,9 @@
},
{
"name": "security",
"posts": ["24.0.0.1", "23.0.0.12",
"posts": ["24.0.0.3",
"DevNexus24", "24.0.0.2-beta",
"24.0.0.1", "23.0.0.12",
"23.0.0.10", "23.0.0.10-beta",
"23.0.0.9", "23.0.0.8",
"23.0.0.6-beta", "22.0.0.13",
Expand Down Expand Up @@ -285,7 +292,7 @@
},
{
"name": "docker",
"posts": ["23.0.0.6",
"posts": ["testcontainers-guide", "23.0.0.6",
"23.0.0.4", "23.0.0.2-beta",
"using-liberty-buildpack-on-azure-and-google-cloud", "22.0.0.11-beta",
"instant-on-beta", "liberty-deep-dive",
Expand Down Expand Up @@ -330,7 +337,8 @@
},
{
"name": "jakarta-ee",
"posts": ["24.0.0.1-beta", "23.0.0.12-beta",
"posts": ["DevNexus24",
"24.0.0.1-beta", "23.0.0.12-beta",
"IvarJakartaData", "23.0.0.10-beta",
"23.0.0.9-beta", "23.0.0.8-beta",
"liberty-ide-tools-maven-gradle-plugins-for-java-developers",
Expand Down Expand Up @@ -379,7 +387,7 @@
},
{
"name": "kubernetes",
"posts": ["aws-instant-on",
"posts": ["DevNexus24", "aws-instant-on",
"using-liberty-buildpack-on-azure-and-google-cloud","instant-on-beta",
"liberty-deep-dive", "liberty-devops-ci-cd-jenkins",
"kube-secrets-210011", "binding-app-to-postgresql-db-with-odo-and-ol-stack",
Expand All @@ -390,7 +398,8 @@
},
{
"name": "community",
"posts": ["IvarJakartaData", "Primeur",
"posts": ["DevNexus24",
"IvarJakartaData", "Primeur",
"kotlin-with-open-liberty", "devnexus",
"23.0.0.1", "2022-year-in-review",
"relicense-eplv2-proposal", "history-maker-projects",
Expand All @@ -416,13 +425,14 @@
},
{
"name": "test",
"posts": ["liberty-deep-dive", "MonicaTamboli_MeetTheTeam",
"posts": ["testcontainers-guide",
"liberty-deep-dive", "MonicaTamboli_MeetTheTeam",
"testing-jakarta-Arquillian-redirect", "eclipse-transformer",
"testing-database-connections-REST-APIs", "liberty-dev-mode-vscode"]
},
{
"name": "developer-experience",
"posts": ["23.0.0.12",
"posts": ["DevNexus24", "23.0.0.12",
"23.0.0.8", "23.0.0.7",
"liberty-ide-tools-maven-gradle-plugins-for-java-developers", "23.0.0.6",
"rapid-startup-instanton", "running-spring-boot-3",
Expand Down Expand Up @@ -478,7 +488,8 @@
},
{
"name": "monitoring",
"posts": ["Primeur", "23.0.0.3",
"posts": ["24.0.0.3",
"Primeur", "23.0.0.3",
"tracing-with-microprofile-telemetry", "separate-stack-trace-22008",
"separate-stack-trace-22008-beta", "logrecordcontext-22007",
"time-based-log-rollover-22007-beta","liberty-deep-dive",
Expand All @@ -496,7 +507,8 @@
},
{
"name": "performance-enhancements",
"posts": ["Java21-Images", "24.0.0.1",
"posts": ["24.0.0.3",
"Java21-Images", "24.0.0.1",
"23.0.0.10-beta", "23.0.0.6",
"rapid-startup-instanton", "23.0.0.5-beta",
"aws-instant-on","instant-on-beta-update",
Expand Down Expand Up @@ -525,9 +537,14 @@
"simplifying-nosql-database-integration-with-jakarta-nosql"
]
},
{
"name": "case-study",
"posts": [ "Primeur", "production-experience-open-liberty"]
},
{
"name": "reactive",
"posts": [ "23.0.0.11-beta", "reactive-developer-guides",
"posts": ["24.0.0.2",
"23.0.0.11-beta", "reactive-developer-guides",
"microprofile-reactive-messaging", "microprofile-reactive-messaging-19009",
"reactive-microservices-microprofile-19004", "jaxrs-reactive-extensions",
"microprofile21-18004"]
Expand All @@ -551,7 +568,8 @@
},
{
"name": "devops",
"posts": ["23.0.0.6", "rapid-startup-instanton",
"posts": ["testcontainers-guide",
"23.0.0.6", "rapid-startup-instanton",
"tracing-with-microprofile-telemetry","23.0.0.2-beta",
"using-codeengine-with-paketo-buildpack-for-liberty", "memory-footprint-throughput-update",
"liberty-deep-dive", "liberty-devops-ci-cd-jenkins"]
Expand Down
Binary file added img/blog/A-B-testing-kubernetes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/AB-type-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/AB-type-2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/AB-type-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/DevNexus2024.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/DevNexusJakartaEETrack.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/DevNexusOLSponsor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/KevinSutter-1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/KevinSutter-2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/KevinSutter-3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/KevinSutter-4.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/KevinSutter-5.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/OpenShift-deployment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/TestContainers3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/amazon-ec2-target-group-creation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/amazon_ecs_hosted_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/amazon_ecs_scaled_instances.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/amazon_ecs_scaling_policy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/amazon_ecs_service_health.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/argocd-image-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/argocd-image-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/argocd-image1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/blog/argocd-image2.png
Binary file added img/blog/argocd1.png
Binary file added img/blog/argocd2.png
Binary file added img/blog/argocd3.png
Binary file added img/blog/argocd4.png
Binary file added img/blog/bootstrap.png
Binary file added img/blog/config-in-volume-mount.png
Binary file added img/blog/configmap-command.png
Binary file added img/blog/configmap-env-mapping.png
Binary file added img/blog/configmap-in-oc1.png
Binary file added img/blog/configmap-in-oc2.png
Binary file added img/blog/configmap-yaml.png
Binary file added img/blog/configuration-drift-1.png
Binary file added img/blog/configuration-drift-2.png
Binary file added img/blog/configuration-drift-3.png
Binary file added img/blog/configuration-drift-4.png
Binary file added img/blog/configuration-drift-5.png
Binary file added img/blog/configuration-drift-6.png
Binary file added img/blog/configuration-drift-7.png
Binary file added img/blog/configuration-drift-chart.png
Binary file added img/blog/configuration-drift-outofsync.png
Binary file added img/blog/configuration-drift-synced.png
Binary file added img/blog/customconfigsource.png
Binary file added img/blog/dev-cluster.png
Binary file added img/blog/dev-cluster1.png
Binary file added img/blog/devsecops-diagram.png
Binary file added img/blog/dt8pic1.png
Binary file added img/blog/dt8pic2.png
Binary file added img/blog/dt8pic3.png
Binary file added img/blog/dt8pic4.png
Binary file added img/blog/dt8pic5.png
Binary file added img/blog/env-variable-results.png
Binary file added img/blog/environmentalParity.png
Binary file added img/blog/guideArchitecture.png
Binary file added img/blog/microprofile.png
Binary file added img/blog/oc-config.png
Binary file added img/blog/oc-secret-config-result.png
Binary file added img/blog/ol-configuration.png
Binary file added img/blog/ol-configuration1.png
Binary file added img/blog/prod-cluster.png
Binary file added img/blog/prod-cluster1.png
Binary file added img/blog/qa-cluster.png
Binary file added img/blog/qa-cluster1.png
Binary file added img/blog/rh_social_media_guide.png
Binary file added img/blog/rh_social_media_logged_in.png
Binary file added img/blog/rh_social_media_login.png
Binary file added img/blog/rh_social_media_redirect.png
Binary file added img/blog/secrets-as-config.png
Binary file added img/blog/server-env.png
Binary file added img/blog/server-xml.png
Binary file added img/blog/testcontainers_banner.png
161 changes: 161 additions & 0 deletions posts/2018-07-09-installing-and-upgrading-liberty.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
---
layout: post
title: "Installing and upgrading Liberty the right way"
date: 2018-06-29 11:30:00 -0000
categories: blog
author_picture: https://avatars3.githubusercontent.com/u/1999406
author_github: https://github.com/barecode
seo-title: Optimizing Spring Boot apps for Docker - OpenLiberty.io
seo-description: Take a more efficient approach to building Docker images for Spring Boot applications when doing iterative development and deployment. The standard approach has some drawbacks so here we look at what they are and how to do it better.
blog_description: "Take a more efficient approach to building Docker images for Spring Boot applications when doing iterative development and deployment. The standard approach has some drawbacks so here we look at what they are and how to do it better."
---
= Installing and upgrading Liberty the right way
Michael Thompson <https://github.com/barecode>

This guide lays out the best practice for upgrading Liberty to the latest version in production environments, assuming a normal operating system environment.
For Docker images, it is recommended that you rebuild your Docker image based on the latest Liberty image available on Docker hub.


== Basic Installation

Open Liberty is packaged as a zip.
At risk of stating the obvious, Liberty can be installed with a simple unzip:

`unzip openliberty-18.0.0.2.zip`

This will lay down the Liberty environment to look like this:

----
$ ls -l wlp
total 320
-rw-r--r-- 1 mcthomps staff 11513 Mar 9 12:23 LICENSE
-rw-r--r-- 1 mcthomps staff 136756 Jun 8 09:37 NOTICES
-rw-r--r-- 1 mcthomps staff 11486 Jun 19 05:08 README.TXT
drwxr-xr-x 24 mcthomps staff 768 Jun 19 05:08 bin
drwxr-xr-x 5 mcthomps staff 160 Jun 19 05:08 clients
drwxr-xr-x 4 mcthomps staff 128 Jun 19 05:08 dev
drwxr-xr-x 455 mcthomps staff 14560 Jun 19 05:08 lib
drwxr-xr-x 4 mcthomps staff 128 Jun 19 05:08 templates
----

That’s it!

That’s the most basic way to install Liberty.
When you want to move up to a newer version, you just unzip the new version and move the `usr` directory, which contains all of your apps and configuration.

This is great for development environments or when you are just kicking the tires.
However, when you are looking at running Liberty for a long time, that is to say in production, there’s a different approach which gives us a more flexibility at the cost of being slightly more complicated.

== Production Installation

In production environments, we recommend taking a few extra setup steps which will end up saving you time in the long run.
First, you should version the unzip to something like `openliberty-18.0.0.2`.
This allows for multiple concurrent versions to be available on-disk.
Second, you should have the applications and configuration stored outside the installation directories.

Let’s look at how to do that.

When you download a version of Open Liberty, it should be extracted to a similarly named directory.
This allows for multiple versions of Liberty to exist side-by-side.

----
cd /opt/ol
curl -sLO https://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/release/2018-06-19_0502/openliberty-18.0.0.2.zip
unzip openliberty-18.0.0.2.zip -d openliberty-18.0.0.2
----

In my environment there are four Open Liberty installs:

----
$ ls -l
total 196736
drwxr-xr-x@ 8 mcthomps staff 256 Sep 27 2017 openliberty-17.0.0.3
drwxr-xr-x@ 8 mcthomps staff 256 Dec 6 2017 openliberty-17.0.0.4
drwxr-xr-x 3 mcthomps staff 96 Jun 19 13:22 openliberty-18.0.0.1
drwxr-xr-x 3 mcthomps staff 96 Jun 30 06:58 openliberty-18.0.0.2
----

Should there be any issues with the application after moving it to the latest version of Liberty, you can quickly revert to using a previous version.

Next, create the `usr` directory.
This directory contains all of the applications and server configuration.
I tend to use the name `wlp-usr`.

----
$ mkdir /opt/ol/wlp-usr
$ ls -l
total 0
drwxr-xr-x@ 8 mcthomps staff 256 Sep 27 2017 openliberty-17.0.0.3
drwxr-xr-x@ 8 mcthomps staff 256 Dec 6 2017 openliberty-17.0.0.4
drwxr-xr-x 3 mcthomps staff 96 Jun 19 13:22 openliberty-18.0.0.1
drwxr-xr-x 3 mcthomps staff 96 Jun 30 06:58 openliberty-18.0.0.2
drwxr-xr-x 11 mcthomps staff 352 Jun 19 15:14 wlp
drwxr-xr-x 2 mcthomps staff 64 Jun 30 06:46 wlp-usr----
----

Lastly, we need to set the environment variable `WLP_USER_DIR` to point to `wlp-usr`.
This will instruct all of the Liberty commands to look for server configuration there, rather than the default directory.

`export WLP_USER_DIR=/opt/ol/wlp-usr`

== Upgrading the version of the server

If you haven't already, create a server.
This can be done from any install version.
This server will be created in the `wlp-usr` directory.

----
$ cd openliberty-18.0.0.1/wlp
$ bin/server create
$ ls /opt/ol/wlp-usr/servers/defaultServer/
apps dropins server.env server.xml workarea
----

Start your server in the foreground with `bin/server run`.

----
$ bin/server run
Launching defaultServer (Open Liberty 18.0.0.1/wlp-1.0.20.cl180120180309-2209) on Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_151-b12 (en_US)
[AUDIT ] CWWKE0001I: The server defaultServer has been launched.
[AUDIT ] CWWKZ0058I: Monitoring dropins for applications.
[ERROR ] CWWKO0221E: TCP Channel defaultHttpEndpoint initialization did not succeed. The socket bind did not succeed for host localhost and port 9080. The port might already be in use.
[AUDIT ] CWWKF0012I: The server installed the following features: [jsp-2.3, servlet-3.1, el-3.0].
[AUDIT ] CWWKF0011I: The server defaultServer is ready to run a smarter planet.
----

Note the version of the server is 18.0.0.1.
To change the version this server is using, stop the server (ctrl-C), change to a different install version, and start it again.

----
$ cd /opt/ol/openliberty-18.0.0.2/wlp
$ bin/server run
Launching defaultServer (Open Liberty 18.0.0.2/wlp-1.0.21.cl180220180619-0403) on Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_151-b12 (en_US)
[AUDIT ] CWWKE0001I: The server defaultServer has been launched.
[AUDIT ] CWWKZ0058I: Monitoring dropins for applications.
[ERROR ] CWWKO0221E: TCP Channel defaultHttpEndpoint initialization did not succeed. The socket bind did not succeed for host localhost and port 9080. The port might already be in use.
[AUDIT ] CWWKF0012I: The server installed the following features: [jsp-2.3, servlet-3.1, el-3.0].
[AUDIT ] CWWKF0011I: The server defaultServer is ready to run a smarter planet.
----

That’s it!

Using this file system layout, changing the version of Liberty that is running is as simple as changing the directory you are starting Liberty from.

== Splitting Output

The logs and other output of the server can be split from the configuration using the `WLP_OUTPUT_DIR` environment variable.
Setting it will cause all of the logs to be written under the specified directory.
Note that this change only takes affect on server start.

----
$ mkdir /opt/ol/wlp-output
$ export WLP_OUTPUT_DIR=/opt/ol/wlp-output
$ bin/server start
$ ls /opt/ol/wlp-output/defaultServer/logs/
console.log messages.log state
----

To preserve these `WLP_USER_DIR` and `WLP_OUTPUT_DIR` environment variables, you will want to set that in your `.bashrc` or create a wrapper script.
You can also add a server.env to the Liberty install’s etc directory.

For more details on the environment variables and other configuration files which you can use to control Liberty, check out the README.TXT in the install.
Loading

0 comments on commit c443083

Please sign in to comment.