Develop Simple on HANA Express in AWS Cloud 9 Checkpoint – How to Catch Up/Restart
- Develop Simple on HANA Express in AWS Cloud 9
- Develop Simple on HANA Express in AWS Cloud 9 Part 2 – The Backend App
- Develop Simple on HANA Express in AWS Cloud 9 Part 3 – The Frontend App
- Develop Simple on HANA Express in AWS Cloud 9 Checkpoint – How to Catch Up/Restart
- Develop Simple on HANA Express in AWS Cloud 9 – An HDI Container inside… a Docker Container?
- Develop Simple on HANA Express in AWS Cloud 9 – Housekeeping with our DB and Backend app
In the past 3 parts of this series, we’ve done a lot of Cloud 9 configuration and coding. As someone whose first job is not that of a technical writer, I know that some steps may not have been clear. I also know as someone who follows along to tutorials, sometimes I just need a ‘fast forward’ or ‘catch up’ button. This will be the point of this part of the series. Or if you happen to massively mess up your progress, this will walk you through quickly getting back up and running as-of Part 3 in the series.
- New AWS Cloud 9 Instance (m4.large (8 GiB RAM + 2 vCPU) recommended) Setup is easy in AWS and takes about 2 or 3 minutes to be up and running.
- DockerHub Account (Free) Since SAP makes you log into Docker Hub to pull their HANA Express image, you’ll want to create a free Docker Hub account to do so.
Catch Up Steps
- Log into Cloud 9 and from a Terminal, type in the following cheat code:
bash <(curl -s https://entmike.github.io/hanadev/quickstart.sh)
- You will be prompted to provide your Docker username and password, so enter them now. If you are a bit leary/curious of what the contents of
quickstart.shis doing, you can look here to see that nothing nefarious is going on, or run each line manually yourself.https://github.com/entmike/hanadev/blob/master/docs/quickstart.sh
- Go grab a coffee, sit back, pat yourself on the back for a hard job well done, and watch the console spam go as your backend and frontend app Docker image is built.
Running the Docker Compose Stack
- From the Terminal, type:
cd hanadev docker-compose up
The first time you bring the stack up, docker-compose will download the HANA Express Docker image and SQLPad Docker image (unless you’ve pulled them before.) AWS Cloud 9 and DockerHub have a pretty fast Internet pipe and this doesn’t take too long. After the images are pulled, HANA Express will run its initial setup script which takes approximately 5-7 minutes to complete (on an EC2
m4.largeinstance.) Subsequent startups take right around 1 minute.
- Once you see the following lines show up, you can continue to the next section.
hxehost_1 | (Post start) Hook /hana/hooks/post_start/201_hxe_optimize: 7s hxehost_1 | (Post start) Hook /hana/hooks/post_start/203_set_hxe_info: 0s hxehost_1 | Post start: 271s hxehost_1 | Overall: 407s hxehost_1 | Ready at: Tue May 21 14:32:01 UTC 2019 hxehost_1 | Startup finished!
Make your Application User for backend
While leaving your
docker-compose up command running in Terminal, open a second Terminal window, and type:
docker exec hanadev_hxehost_1 /usr/sap/HXE/HDB90/exe/hdbsql -n localhost:39017 -u SYSTEM -p HXEHana1 "CREATE USER APPUSER PASSWORD HXEHana1 NO FORCE_FIRST_PASSWORD_CHANGE;"
Note: Leave the password as
HXEHana1 if you are following these steps exactly. This is because the docker-compose
.env file has this password set as the same. If you wish, you may modify the
hanadev/.env file with a different password and also modify the statement above to match that different password.
Open up Ports
- At the top-right of your Cloud 9 IDE, locate the Root icon (Looks like a circle with the letter ‘R’) and click Manage EC2 Instance
- Locate the Security Groups property near the bottom half of the EC2 details and click on the rule starting with
aws-cloud9-..... This will take you to the Security group of your Cloud 9 EC2 instance.
- Click on the Inbound tab and click Edit
- Add the following ports:
Port Source Description
Test Run your Stack
There are 2 ways to test your running stack’s apps.
Option 1 – Run in Cloud 9
Click Preview -> Preview Running Application. Cloud 9 IDE will by default look for an app running on port
8080 which our Docker compose stack is set up to expose. You should get a browser panel inside your IDE with a page saying ‘HANA Sandbox’ with your HANA DB system details displayed.
Option 2 – Run via External IP
This option is more flexible, because we can more easily change the ports clearly.
- Click Share at the top right of your Cloud 9 IDE and copy the Application IP address
- In a new browser tab, navigate to one of the following URLs where
188.8.131.52is your Application IP address.
App Example URL SQLPad
Back up and running in under 10 minutes!
This quick post hopefully helps those who may have struggled with copy and pasting a bunch of code, or those who, like me, might be quite clumsy and have messed up their project/IDE. We will continue with enhancing our application in Part 4 soon.