Try Azure Service Fabric (Java) on Mac-Local Environment

Introduction

I tried Azure Service Fabric (Java), so I will keep it as a record.

Operation check environment

OS: macOS Mojave Version 10.14.6 (18G84)

STS: Spring Tool Suite 4 Version: 4.5.0.RELEASE Build Id: 201912171052

Eclise: Eclipse IDE for Java Developers Version: 2019-12 (4.14.0) Build id: 20191212-1212

1. Preparation

1.1 CLI Azure Service Fabric CLI

1.2 Local development environment

Set up your development environment on Mac OS X

1.3 Commands often used this time

docker run -itd -p 19080:19080 -p 19000:19000 -p 25100-25200:25100-25200 -p 8080:8080 -v [/Users/tworks55/eclipse-workspaces/mySFWorkspace]:/tmp/mySFWorkspace --name sfonebox mysfcluster

* [/Users/tworks55/eclipse-workspaces/mySFWorkspace]Part is changed according to the environment

sfctl cluster select --endpoint http://localhost:19080

docker logs sfonebox
docker stop sfonebox
docker rm -f sfonebox

1.3 URLs often used this time

http://localhost:19080/ http://localhost:8080/

2. Verification result

2.1 Quick Start: Deploy the Java Spring Boot app on Azure Service Fabric

Quick Start: Deploy Java Spring Boot App on Azure Service Fabric (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-quickstart-java-spring-boot)

Deployment is possible for the time being, but Scale up / Fail Over is not good. It may be unavoidable because it is a local environment.

As a caveat

--Don't forget -p 8080: 8080 when launching sftestcluster --The name of the jar file written in entryPoint.sh matches the one that was built. --If you scale and make 3 instances, Port will be covered and an error will occur (as expected?) --Restart the running instance and Fail Over, but DownTime occurs (cause unknown)

It is around.

Image after startup image.png

2.2 Quick Start: Deploy Java App on Azure Service Fabric on Linux

Quick Start: Deploy Java App on Azure Service Fabric on Linux (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-quickstart-java-reliable-services)

Plugin cannot be used in Eclipse / STS on Mac. Right-clicking on Project does not bring up the Service Fabric menu.

Right-click on the project and select Publish Application from the Service Fabric dropdown.

Cannot be operated.

2.3 Tutorial: Create an application that includes Java API front-end services and stateful back-end services on Azure Service Fabric

[Tutorial: Create an application with Java API front-end service and stateful back-end service on Azure Service Fabric](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric- tutorial-create-java-app)

Plugin cannot be used in Eclipse / STS on Mac. I get an error like this when I try to create a Project. image.png It seems that Windows is not good for Linux in the first place, but what about Mac? https://github.com/MicrosoftDocs/azure-docs/issues/30819

As long as you check the following, it seems that you can go on a Mac. https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/service-fabric/service-fabric-get-started-eclipse.md

[!NOTE] If Eclipse isn't working as expected on your Mac, or needs you run as super user), go to the ECLIPSE_INSTALLATION_PATH folder and navigate to the subfolder Eclipse.app/Contents/MacOS. Start Eclipse by running ./eclipse.

2.4 Develop Java Service Fabric applications using Visual Studio Code

Develop Java Service Fabric applications using Visual Studio Code (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-develop-java-applications-with-vs -code)

Even if I built it using Service Fabric Reliable Services extension for VSCode, it was not built, so I built it in Terminal. (Gradle quits without doing anything, maybe the PATH from VS Code is not enough)

VSCODE.


/asf/service-fabric-java-quickstart $ gradle 

> Task :help

Welcome to Gradle 6.0.1.

To run a build, run gradle <task> ...

To see a list of available tasks, run gradle tasks

To see a list of command-line options, run gradle --help

To see more detail about a task, run gradle help --task <task>

For troubleshooting, visit https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 685ms
1 actionable task: 1 executed
~/asf/service-fabric-java-quickstart $ gradle --version

------------------------------------------------------------
Gradle 6.0.1
------------------------------------------------------------

Build time:   2019-11-18 20:25:01 UTC
Revision:     fad121066a68c4701acd362daf4287a7c309a0f5

Kotlin:       1.3.50
Groovy:       2.5.8
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          1.8.0_231 (Oracle Corporation 25.231-b11)
OS:           Mac OS X 10.14.6 x86_64

~/asf/service-fabric-java-quickstart $ gradle

> Task :help

Welcome to Gradle 6.0.1.

To run a build, run gradle <task> ...

To see a list of available tasks, run gradle tasks

To see a list of command-line options, run gradle --help

To see more detail about a task, run gradle help --task <task>

For troubleshooting, visit https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 584ms
1 actionable task: 1 executed

terminal.



~/asf/service-fabric-java-quickstart/Voting $ gradle

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 32s
15 actionable tasks: 11 executed, 4 up-to-date
~/asf/service-fabric-java-quickstart/Voting $ 

After that, install it with the extension function and it works normally. The atmosphere that the extension of VS CODE is not stable yet.

image.png

Recommended Posts

Try Azure Service Fabric (Java) on Mac-Local Environment
Try Health Check on Azure App Service.
Try to build Java8 environment on Amazon Linux2
Build Redmine on Azure App Service
Install Java development environment on Mac
Java development environment construction memo on Mac
Try calling the CORBA service in Java 11+
Build a Java development environment on Mac
Build Java 8 development environment on AWS Cloud9
Add Document to Azure Search Service (Java)
Try the Docker environment on AWS ECS
Try running ScalarDB on WSL Ubuntu (Environment Construction)
[Java] Build Java development environment on Ubuntu & check execution
Try calling the CORBA service from Spring (Java)
Try communication using gRPC on Android + Java server
Build a Java runtime environment on Sakura VPS
[Java] Environment construction
Try Java 8 Stream
Java environment construction
Java development environment
Roughly try Java 9
Using Java 8 with Bluemix (on Liberty Runtime & DevOps Service)
Create a Java development environment using jenv on Mac
Build Java development environment with VS Code on Mac
Java development environment construction on Mac-JDK Install (2020 preservation version)
Change Java heap size in Tomcat in Azure App Service
Deploy Java apps on the IBM Cloud Kubernetes service
Get Azure App Service for Java Configuration with System.getEnv ()
Try image classification using TensorFlow Lite on Android (JAVA)
Run kuromoji on Win10 + Eclipse + Java environment (January 2020 version)
Try to build a Java development environment using Docker
Creating a lightweight Java environment that runs on Docker