EC2 Amazon: Set up autoscaling tools environment without JRE? - java

I am following this guide here:
http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/UsingTheCommandLineTools.html
I don't have JRE, although I have Java 7 setup (I develop in Java). So, I believe that I am stuck on this step in the tutorial: export JAVA_HOME=/usr/local/jre (but my /usr/local does not have JRE.)
See information here:
lucas#lucas-ThinkPad-W520:~$ ls /usr/local/
bin etc games include lib man sbin share src
lucas#lucas-ThinkPad-W520:~$ which java
/usr/bin/java
lucas#lucas-ThinkPad-W520:~$ which jre
lucas#lucas-ThinkPad-W520:~$
Should I install JRE separately, or is there a way to configure my system to work with these auto-scaling tools?

You should not use as-cmd anymore. Please use AWS CLI. Here is the AWS CLI relevant autoscaling commands
The reason being, as-cmd is not maintained by Amazon anymore and all the old CLI features have been exported to AWS CLI. AWS CLI is a one stop shop for all the AWS Services unlike older CLIs where you had to install a separate CLI for individual services.
as-cmd is JAva based and hecne your question. However, AWS-CLI is python based and in my opinion (which is ofcourse subjective), It is bit faster than older JAva based AWS CLIs.
AWS CLI provides output in JSON format which is much more easier to parse.
BESIDES, You don't have to play with CLI for autoscaling. Now, you can do the same job via AWS Console.

Your best bet is to download JRE.
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Bottom right of that page. Small download should be done within seconds. Hope this helps

Related

How can i install Java 8 to Google Compute Engine (Debian 10)

First of all, I would like to say that I'm not a programmer and I am not experienced in the field. I was trying to set up a Minecraft server in the Google Compute Engine and I set it up successfuly. However, when I tried to switch it to a different version I could not open it because the server was running java 11. I removed it and tried a bunch of things to install Java 8 but I couldn't do it. Is there a way that i can reliably use to install java 8 to my server?
As you just pointed out, Debian 10's default and only officially supported java runtime is openjdk-11-jre.
Oracle provides their guide to download java on their website (https://java.com/en/download/help/linux_x64_install.html#download), which you can download, extract, and run.
I also found a nvidia-openjdk-8-jre package in the non-free repository of debian buster / bullseye. It exists for compatibility reasons and it's not recommendeded, but it might work.

Amazon Elastic Beanstalk Java How To Get Oracle JDK

I am new to Amazon web services and have recently inherited a lot of existing services.
One of the things I've been desperately needing is for our Amazon Elastic Beanstalk instance to be using Sun's Oracle JDK rather than openJDK.
This inconsistency has been making my java functionalities not working as expected since I do java development using Sun's Oracle JDK. Our legacy code is based on JDK7.
For example, the JPEG codec doesn't exist in openJDK, and the javascript Rhino engine doesn't support a JSON.stringify function. I've made workarounds to these, but that's just avoiding the bigger issue which is that I have no idea what openJDK doesn't support, and Oracle JDK seems to support just about everything.
According to the previous owner, I was recommended not to create my own "AMI" because then I would have to take care of all the internal resources myself. I was told that doing so would defeat the purpose of Elastic Beanstalk supposedly handling everything for us.
I cannot seem to find a straight answer around. I do not want to leave the Elastic Beanstalk ecosystem. I'm under the assumption that Amazon's EC2 is a whole different ecosystem where I would have to manage all the server's internals myself.
I just want to know, as of this current day, is it possible to have an Elastic Beanstalk instance for Tomcat7 with Oracle JDK?
I am hoping that it is simply a simple configuration change somewhere on the site.
How can can this be done?
You can install you preferred JDK and change the java linux link to it, so it'll be the default one.
Since EB instances are automatically created and destroyed by EB, you need to include a small script that instructs EB to make the required java change whenever it decides to spin up a new web instance.
Now to do that you need to need to write a conf file and place it in a .ebextensions folder. in that file you manually install java and replace it with the current one.
The formal (tiring) documentation about eb config files is here.
To get you up and running fast, check out this gist.

AWS S3 local server for integration testing

I have some code that uploads and downloads files using AWS S3 (using the Java AWS SDK). I want to be able to write some tests for it, I was wondering if anyone has any good options. Ideally I would like a light-weight S3 server that runs locally that can be started fast and requires no system configuration (the tests need to be run by Jenkins).
Some options I have looked at so far:
FakeS3 - Almost exactly what I'm looking for, however, when using the Java AWS SDK, you must edit your /etc/hosts file and restart networking, not something I can do in Jenkins. Also when trying it out there seems to be a bug with the creation date field being formatted wrong which makes my client throw an exception, which doesn't inspire me with much confidence in the project.
Ceph - Implements S3 API but takes several minutes to install
You can try localstack, which is an open source local AWS cloud stack made for testing. It provides implementations of several of AWS services, including S3.
It looks like a very popular open source project on GitHub.
You can try installing minio server on your laptop/system, its open source & single static binary. Server is S3 compatible. Then you can try minio-java client library for all operations, following is basic operations example.
Installing minio server [GNU/Linux]
$ wget https://dl.minio.io/server/minio/release/linux-amd64/minio
$ chmod 755 minio
$ ./minio --help
Hope it helps
Disclaimer: I work for Minio
Late answer, will be useful mostly for Docker users. There's a great S3 compatible storage software called Riak CS and there's docker-riak-cs image that allows to quickly launch the server.
I've been using it for nearly 2 years for local development and integration testing with great success. It has some limitations, but nothing major that comes in the way, see api / compatibility documentation.
If you need Docker-less solution, you can set it up locally for each build, all setup and configuration scripts are available in docker-riak-cs repository.
Minio offers (in my opinion) the best set of features, flexibility and ease of use.
It is available as a docker container or binary for major OSes.
To start with minio, it is as easy as:
Download
Start the binary minio server /data
Use it
It works flawlessly with s3cmd and it has nice documentation for popular programming languages.
I started a S3 Server API project for Ladon, it contains a simple File System Repository. Its a Java Project and contains a Spring Boot Starter for simple testing. Not all S3 API features are supported yet but I will add them on request. Its on Github: Ladon S3 Server
findify/s3mock - an in-process, Java S3 server aimed at testing. Didn't test it - just stumbled upon it. Needs no docker, which might be an advantage. HTH! :)
ive tried both minio and localstack, and the problem with localstack is that the storage in the s3 bucket is not persistence. I think only if you have the pro version it will support percistency. minio was very easy to use, and it is persistent for free.
I created different buckets to use for the different use cases. For example: my-dev-bucket and my-prod-bucket. I don't know if this meets your use criteria but you might want to consider it. The side benefit is it makes your pre production and production code follow the exact same flows.

What's the fastest way to register a java-application (or maybe a bat executing the app) as a Windows service?

What's the fastest way to register a java-application (or maybe a bat executing the app) as a Windows service?
Update 1: It has to be free for companies to execute :)
Either by using a third party app or following a guide.
I recently tried a bunch and had most luck with Java service wrapper There is a cummunity edition which is gpl as well as commercially supported versions

Which Java library for creating Solaris pkg software packages?

Which Java library are people using to create Solaris pkg software packages? We are developing an application that has, as one if its features, the ability to bundle backend services as a pkg software package which can be easily installed in Solaris. I am hoping that there is a Java library that makes building pkg's a painless process.
If there is no library for this could you point me to a resource that describes how to build a pkg?
I don't have any particular experience with it but you could maybe use the solaris-maven-plugin which seems to be a wrapper around pkgmk and pkgtrans. See the usage guide and the Best Practices and Examples document to get an idea of the involved steps.
See also ant script and solaris package for an ant based example (which also just calls the pkgmk and pkgtrans commands).
heirloom might be an option if you are on linux ... but still not java :( binaries for redhat are here, there should be something for ubuntu as well. debian i could not find.

Categories