Skip to content

Commit 85d8304

Browse files
authored
Merge pull request #47358 from JimacoMS2/sf-1269356-linux-publish
User Story 1269356: [Java] [CSS SIRT] Documentation for using the Eclipse with secured Linux cluster
2 parents 821cf78 + 0ef5357 commit 85d8304

File tree

4 files changed

+87
-16
lines changed

4 files changed

+87
-16
lines changed
17.8 KB
Loading
17.8 KB
Loading
71.6 KB
Loading

articles/service-fabric/service-fabric-get-started-eclipse.md

Lines changed: 87 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ Install Eclipse Neon or later from the [Eclipse site](https://www.eclipse.org).
4040
Install the Service Fabric plug-in, in Eclipse, go to **Help** > **Install New Software**.
4141
1. In the **Work with** box, enter **http://dl.microsoft.com/eclipse**.
4242
2. Click **Add**.
43-
![Service Fabric plug-in for Eclipse][sf-eclipse-plugin-install]
43+
44+
![Service Fabric plug-in for Eclipse][sf-eclipse-plugin-install]
4445
3. Select the Service Fabric plug-in, and then click **Next**.
4546
4. Complete the installation steps, and then accept the Microsoft Software License Terms.
4647

@@ -82,35 +83,99 @@ If you already have the Service Fabric plug-in installed, install the latest ver
8283

8384
![Service Fabric New Project page 6][create-application/p6]
8485

85-
## Build and deploy a Service Fabric application in Eclipse
86+
## Build a Service Fabric application in Eclipse
8687

8788
1. Right-click your new Service Fabric application, and then select **Service Fabric**.
8889

8990
![Service Fabric right-click menu][publish/RightClick]
9091

91-
2. In the submenu, select the option you want:
92+
2. In the context menu, select one of the following options:
9293
- To build the application without cleaning, click **Build Application**.
9394
- To do a clean build of the application, click **Rebuild Application**.
9495
- To clean the application of built artifacts, click **Clean Application**.
96+
97+
## Deploy a Service Fabric application to the local cluster with Eclipse
98+
99+
After you have built your Service Fabric application, follow these steps to deploy it to the local cluster.
100+
101+
1. If you haven't started the local cluster, follow the instructions in [Set up a local cluster](./service-fabric-get-started-linux.md#set-up-a-local-cluster) to start your local cluster and make sure that it is running.
102+
2. Right-click your Service Fabric application, and then select **Service Fabric**.
103+
104+
![Service Fabric right-click menu][publish/RightClick]
105+
106+
3. From the context menu, click **Deploy Application**.
107+
4. You can follow the progress of the deploy operation in the Console window.
108+
5. To verify that your application is running, open Service Fabric Explorer on your local cluster in a browser window [http://localhost:19080/Explorer](http://localhost:19080/Explorer). Expand the **Applications** node and make sure your application is running.
109+
110+
To learn how to debug your application in Eclipse using the local cluster, see [Debug a Java service in Eclipse](./service-fabric-debugging-your-application-java.md).
111+
112+
You can also deploy your application to the local cluster wuth the **Publish Application** command:
113+
114+
1. Right-click your Service Fabric application, and then select **Service Fabric**.
115+
2. From the context menu, click **Publish Application...**.
116+
3. In the **Publish Application** window, choose **PublishProfiles/Local.json** as the Target Profile and click **Publish**.
117+
118+
![Publish Dialog Local](./media/service-fabric-get-started-eclipse/localjson.png)
119+
120+
By default, the Local.json publishing profile is set up to publish to the local cluster. For more information about the connection and endpoint parameters present in publishing profiles, see the next section.
121+
122+
## Publish your Service Fabric application to Azure with Eclipse
123+
124+
To publish your application to the cloud, follow these steps:
125+
126+
1. To publish your application to a secure cluster in the cloud, you need an X.509 certificate to use to communicate with your cluster. In test and development environments, the certificate used is often the cluster certificate. In production environments, the certificate should be a client certificate that is distinct from the cluster certificate. You need both the certificate and the private key. The certificate (and key) file must be PEM-formatted. You can create a PEM file that contains the certificate and private key from a PFX file with the following openssl command:
95127

96-
3. From this menu, you also can deploy, undeploy, and publish your application:
97-
- To deploy to your local cluster, click **Deploy Application**.
98-
- In the **Publish Application** dialog box, select a publish profile:
99-
- **Local.json**
100-
- **Cloud.json**
128+
```bash
129+
openssl pkcs12 -in your-cert-file.pfx -out your-cert-file.pem -nodes -passin pass:your-pfx-password
130+
```
101131

102-
These JavaScript Object Notation (JSON) files store information (such as connection endpoints and security information) that is required to connect to your local or cloud (Azure) cluster.
132+
If the PFX file is not password protected, use `--passin pass:` for the last parameter.
103133

104-
![Service Fabric Publish menu][publish/Publish]
134+
2. Open the **Cloud.json** file under the **PublishProfiles** directory. You need to configure the cluster endpoint and security credentials appropriately for your cluster.
135+
136+
- The `ConnectionIPOrURL` field contains the IP address or URL of your cluster. Note that the value does not contain the URL scheme (`https://`).
137+
- By default the `ConnectionPort` field should be `19080`, unless you explicitly have changed this port for your cluster.
138+
- The `ClientKey` field should point to a PEM-formatted .pem or .key file on your local machine that contains the private key for your client or cluster certificate.
139+
- The `ClientCert` field should point to a PEM-formatted .pem or .crt file on your local machine that contains the certificate data for your client or cluster. certificate.
140+
141+
```bash
142+
{
143+
"ClusterConnectionParameters":
144+
{
145+
"ConnectionIPOrURL": "lnxxug0tlqm5.westus.cloudapp.azure.com",
146+
"ConnectionPort": "19080",
147+
"ClientKey": "[path_to_your_pem_file_on_local_machine]",
148+
"ClientCert": "[path_to_your_pem_file_on_local_machine]"
149+
}
150+
}
151+
```
152+
153+
2. Right-click your Service Fabric application, and then select **Service Fabric**.
154+
3. From the context menu, click **Publish Application...**.
155+
3. In the **Publish Application** window, choose **PublishProfiles/Cloud.json** as the Target Profile and click **Publish**.
156+
157+
![Publish Dialog Cloud](./media/service-fabric-get-started-eclipse/cloudjson.png)
158+
159+
4. You can follow the progress of the publish operation in the Console window.
160+
5. To verify that your application is running, open Service Fabric Explorer on your Azure cluster in a browser window. For the example above, this would be: `https://lnxxug0tlqm5.westus.cloudapp.azure.com:19080/Explorer`. Expand the **Applications** node and make sure your application is running.
161+
162+
163+
On secure Linux clusters, if your application contains Reliable Services services, you will also need to configure a certificate that your services can use to call Service Fabric runtime APIs. To learn more, see [Configure a Reliable Services app to run on Linux clusters](./service-fabric-configure-certificates-linux.md#configure-a-reliable-services-app-to-run-on-linux-clusters).
164+
165+
For a quick walk through of how to deploy a Service Fabric Reliable Services application written in Java to a secure Linux cluster, see [Quckstart: Deploy a Java Reliable Services application](./service-fabric-quickstart-java-reliable-services.md).
166+
167+
## Deploy a Service Fabric application by using Eclipse run configurations
105168

106169
An alternate way to deploy your Service Fabric application is by using Eclipse run configurations.
107170

108-
1. Go to **Run** > **Run Configurations**.
109-
2. Under **Gradle Project**, select the **ServiceFabricDeployer** run configuration.
110-
3. In the right pane, on the **Arguments** tab, for **publishProfile**, select **local** or **cloud**. The default is **local**. To deploy to a remote or cloud cluster, select **cloud**.
111-
4. To ensure that the proper information is populated in the publish profiles, edit **Local.json** or **Cloud.json** as needed. You can add or update endpoint details and security credentials.
112-
5. Ensure that **Working Directory** points to the application you want to deploy. To change the application, click the **Workspace** button, and then select the application you want.
113-
6. Click **Apply**, and then click **Run**.
171+
1. In Eclipse, go to **Run** > **Run Configurations**.
172+
2. Under **Gradle Project**, select the **ServiceFabricDeployer** run configuration.
173+
3. In the right pane, on the **Arguments** tab, make sure the **ip**, **port**, **clientCert**, and **clientKey** parameters are set appropriately for your deployment. By default, the parameters are set to deploy to the local cluster as in the following screenshot. To publish your app to Azure you can modify the parameters to contain the endpoint details and security credentials for your Azure cluster. For more information, see the previous section, [Publish your Service Fabric application to Azure with Eclipse](#publish-your-service-fabric-application-to-azure-with-eclipse).
174+
175+
![Run Configuration Dialog Local](./media/service-fabric-get-started-eclipse/run-config-local.png)
176+
177+
5. Make sure that **Working Directory** points to the application you want to deploy. To change the application, click the **Workspace** button, and then select the application you want.
178+
6. Click **Apply**, and then click **Run**.
114179

115180
Your application builds and deploys within a few moments. You can monitor the deployment status in Service Fabric Explorer.
116181

@@ -160,6 +225,12 @@ The application upgrade takes a few minutes. You can monitor the application upg
160225
## Migrating old Service Fabric Java applications to be used with Maven
161226
We have recently moved Service Fabric Java libraries from Service Fabric Java SDK to Maven repository. While the new applications you generate using Eclipse, will generate latest updated projects (which will be able to work with Maven), you can update your existing Service Fabric stateless or actor Java applications, which were using the Service Fabric Java SDK earlier, to use the Service Fabric Java dependencies from Maven. Please follow the steps mentioned [here](service-fabric-migrate-old-javaapp-to-use-maven.md) to ensure your older application works with Maven.
162227

228+
## Next steps
229+
230+
- For quick steps on building Java Reliable service application and deploying it locally and to Azure, see [Quckstart: Deploy a Java Reliable Services application](./service-fabric-quickstart-java-reliable-services.md).
231+
- To learn how to debug a Java application on your local cluster, see [Debug a Java service in Eclipse](./service-fabric-debugging-your-application-java.md).
232+
- To learn how to monitor and diagnose Service Fabric applications, see [Monitor and diagnose services in a local machine development setup](./service-fabric-diagnostics-how-to-monitor-and-diagnose-services-locally-linux.md).
233+
163234
<!-- Images -->
164235

165236
[sf-eclipse-plugin-install]: ./media/service-fabric-get-started-eclipse/service-fabric-eclipse-plugin.png

0 commit comments

Comments
 (0)