ORLEANS REMOTE DEPLOYMENT

Orleans Remote Deployment

Table of Contents

Overview: 1

Prerequisites. 2

Deployment Steps. 2

Orleans Deployment Manifest 3

Orleans Silo Configuration. 4

Gateway Load Shedding. 5

Orleans Powershell Scripts. 6

Deploying Orleans using Powershell Script 6

Confirming Orleans Status. 7

Monitoring Orleans. 7

Gathering Orleans Log Files. 8

Removing Orleans. 8

 

Overview:

Orleans based services are xcopy deployable. All you need to do to deploy an Orleans based service to a set of machines is copy the following set of file to the target machines and start the OrleansHost.exe host process:

  • ·       Content of [SDK-Root]\Binaries\OrleansServer folder
  • ·       OrleansConfiguration.xml file with configuration for the deployment to replace the default placeholder from [SDK-Root]\Binaries\OrleansServer
  • ·       Binaries with grain interfaces and grain implementation classes of the service along with any external dependencies to Application\<service name> subdirectory of the folder on the target with binaries from [SDK-Root]\Binaries\OrleansServer

This simple task may be accomplished in many different ways and with different tools, such as Autopilot. The SDK includes a set of PowerShell scripts that provide a way to deploy an Orleans based service to a cluster of machines and remote start the hosting processes on them. There are also scripts for un-deploying a service, monitoring its performance, start and stop it, and collect logs. These are the scripts we found useful for ourselves while building and testing Orleans.

Prerequisites

The following table lists the prerequisites for deploying and running Orleans on a remote machine:


Prerequisite


Details


.Net Framework 4.0


Orleans runs under the .Net Framework 4.0, which can be installed from this link: http://www.microsoft.com/downloads/details.aspx?FamilyID=9cfb2d51-5ff4-4491-b0e5-b386f32c0992&displaylang=en


Powershell 2.0 with WinRM


Windows 7 and Windows Server 2008 R2 should have these installed by default.

For other versions of windows, select the appropriate download from this
article: http://support.microsoft.com/kb/968929

To confirm you are running the required version of
PowerShell, start a PowerShell window and type Get-Host –  the resulting output needs to say “Version: 2.0”


WinRM Configuration


Both the source and target machines must be configured
for remote operations: Open a PowerShell window as an Administrator and run
the command below on the target machine (enter ‘y’ at the prompts):

winrm quickconfig


Increase PowerShell job memory


Set the memory limit
on remotely invoked jobs to 4Gb:

Set-Item
wsman:localhost\Shell\MaxMemoryPerShellMB 4096

To change it on a
remote machine, use the following steps:

  • ·      
    Connect-WSMan
    -ComputerName <string>
  • ·      
    Set-Item wsman:<computerName>\Shell\MaxMemoryPerShellMB
  • ·      
    Disconnect-WSMan
    –ComputerName <string>

PowerShell Execution Policy set to run remote scripts


Open a PowerShell window as an Administrator and run the command
below on the target machine(enter ‘y’ at the prompt):

Set-ExecutionPolicy RemoteSigned

This will set the machine to require signing for remote scripts
only.

Deployment Steps

Note that the user running the scripts
must be a member of the Administrators Group on the remote machines.

The basic steps are as follows:

1.      
Setup a deployment manifest
(Deployment.xml).

2.      
Adjust the Orleans
Configuration (OrleansConfiguration.xml) to suit the environment.

3.      
Run the PowerShell deployment
scripts to deploy Orleans into your remote environment.

Orleans Deployment Manifest

The Orleans Deployment scripts use a
manifest (XML) file to specify details of the deployment, including source and
destination locations and local or remote machines to be deployed to.

By making small changes to an existing
deployment manifest xml file (typically by listing the different host
machines), the same PowerShell scripts can deploy and run that Orleans system
on a set of remote machines with equal ease as deploying and running that
system on the local machine.

The default file name for the manifest
is Deployment.xml, and if you just modify this file, it will not be necessary
to specify a different name.  There are
times, such as during testing, it may be advantageous to maintain multiple
deployment files that specify a different set of silos.  These other files may be specified explicitly
to the deployment tools as specified in the respective sections below.

A Deployment manifest contains many
different items, which collectively allow deployment of the Orleans runtime and
applications onto a variety of local and remote configurations:

  • ·      
    Source location for the Orleans system runtime

o   Located in the “Path” attribute of the <Deployment><Packages><Package>
element where the “Type” attribute is set to “System”.

o   Typically: [ORLEANS-SDK]\Binaries\OrleansServer.

o  
Example: <Package Name="Orleans Runtime"
Type="System" Path="." />

  • ·      
    Source location for any
    additional Orleans applications / grains
    to be included in this Orleans system

o  
Also located in the
<Deployment><Packages><Package> nodes.

o  
The “Type” attribute must be set to “Application”.

o  
Use the “Filter” attribute to
constrain the files deployed

o  
<Package
Name="Chirper" Type="Application"
Path="..\Binaries\Applications\Chirper" />

  • ·      
    Source location for the server configuration file to be used by
    the Orleans host process

o  
Located in the “Path” attribute
<Deployment><RuntimeConfiguration> element.

o  
The file name must be OrleansConfiguration.xml – if necessary,
just change the path.

o  
Example: <RuntimeConfiguration
Path=".\OrleansConfiguration.xml" />

  • ·      
    Target location to install the Orleans
    server-side binaries on each machine.

    Typically: C:\Orleans (for test or production nodes) or [ORLEANS-SDK]\LocalSilo (for the local development silo).

o  
Located in the <Deployment><TargetLocation>
element.

o  
Must be an absolute path (i.e. no “..”
locations).

o  
Example: <TargetLocation
Path="C:\Orleans" />

  • ·      
    The set of silos (host machines and optional silo names) this Orleans system
    should to be deployed to.

o   Located in the <Deployment><Nodes><Node> elements.

o   Typically: Primary on localhost, or multiple machines with one silo each.

o   The “HostName” attribute specifies the machine name.

o   The “NodeName” attribute specifies the name of the silo.  Generally, this is arbitrary, with the
exception that if multiple silos will run
on any one machine, then silo names must be unique
.

o   Example:

<Nodes>

<Node
HostName="MACHINE1" NodeName="Primary" />

<Node
HostName="MACHINE2" NodeName="Node2" />

<Node
HostName="MACHINE3" NodeName="Node3" />

<Nodes />

  • ·      
    Deployment Group ID – this is a GUID
    which distinguishes one Orleans runtime system from another, even if both
    Orleans systems are running on the same machines.

o  
Located in the
<Deployment> element.

o  
Example:

<Deployment

Name="Deployment1"

DeploymentGroup="F219832A-1EE1-45DA-B35D-0BB3060C9FDA"

xmlns="urn:xcg-deployment">

Orleans Silo Configuration

Refer to the configuration guide - Orleans-Configuration.docx
- for information on how to configure silos.

Orleans Powershell Scripts

The following sections detail the
PowerShell scripts provided with Orleans to aid with deployment and monitoring.
(Use the /? option to get the latest usage info directly from the scripts.)


Script Name


Parameters


Description


DeployOrleansSilos.ps1


[$deploymentConfigFile]


Copies the Orleans files to machines specified in the
deploymentConfigFile (default is Deployment.xml).


UndeployOrleansSilos.ps1


[$deploymentConfigFile]


Stops and removes Orleans from the
deployment servers deploymentConfigFile (default is Deployment.xml).


MonitorOrleansSilos.ps1


[$deploymentConfigFile]

[$networkInstance]
[$samplesToLog] [$headerInterval]

[$repeatHeaderInFile


Monitors CPU, Memory, Network Send, and
Network Receive performance counters, and logs the data to files both as an
aggregate of all data, and in separate files for each server.  See usage text for details about the
parameters.


ShowOrleansSilos.ps1


[$deploymentConfigFile]


Does a quick survey of the deployment
silos and reports if Orleans is running on them.


GatherOrleansSiloLogs.ps1


[$deploymentConfigFile]

[$outputPath]


Retrieve all log files from deployment
silos and stores them in the specified output folder.


UtilityFunctions.ps1


none


Provides ancillary functionality to the
other scripts.

Deploying Orleans using Powershell
Script

Start a separate
PowerShell command window as an administrator.

Execute the DeployOrleansSilos.ps1script, providing the location of the deployment configuration file
(deployment.xml is the default and will be used if you don’t supply a value).

Examples:   .\DeployOrleansSilos.ps1

.\DeployOrleansSilos.ps1
C:\Orleans\MyDeploy.xml

The deployment
will execute the following steps:

1.   
Stop any running instances of Orleans that are running on the
deployment machines.

2.   
Copy the Orleans files and any application files that are listed in
the deployment manifest.

3.   
When the copy is completed, start the silos.  This will pause after starting the first silo
so that it is available for the other silos to register with.

4.   
Pause to allow the start-up to complete.

5.   
Report the progress of the deployment.

When the deployment is complete, Orleans
is ready for clients to connect to it.

Confirming Orleans Status

To determine if Orleans is running on
the servers in the deployment manifest, run the ShowOrleansSilos.ps1 script.

If you have used a deployment manifest
file named something other than the default, specify it on the command line.

Examples:  
.\ShowOrleansSilos.ps1

.\ShowOrleansSilos.ps1
C:\Orleans\MyDeploy.xml

Monitoring Orleans

Once Orleans is
deployed, you can start an optional script that will monitor the Orleans
deployment using standard performance counters. 
Run a dedicated PowerShell command prompt as an administrator, and
execute the .\MonitorOrleans.ps1
script to start monitor performance counters for an Orleans Deployment.

The following
parameters configure the monitoring to suit individual circumstances:


Parameter


Description


Default


DeploymentConfigFile


The deployment manifest used to install
Orleans.


Deployment.xml


NetworkInstance


The name of the network for the network performance counters.


corp


SamplesToLog


The number of samples to record in the
current run.   Use Ctrl-C to stop the
script sooner.


480 which taken in one minute intervals
should continue for eight hours


HeaderInterval


The number of samples to write before repeating the header.


10


RepeatHeaderInFile


If this switch is present, the header will
be repeated in the log file at the interval specified by the previous
parameter.


Only include the header at the top of the
file.

The script will
store the data in the following types listed below.  The files will be written to a folder called PerformanceData
under the directory where the monitoring script is run from.


File
Type


Description


FileNameBase


Machine Specific


Contains only the data for a single
machine.  If there are four machines in
the deployment, then there will be four of these files.


“PerfData-“ + the machine name  and the Date/Time stamp.


Combined


Contains all of the data for all machines consolidated into a
single file.


“ConsolidatedPerfData-“
+ the Date/Time stamp.

       

Gathering Orleans Log Files

To retrieve all log files from
deployment silos and store them in the specified output folder, run the GatherOrleansSiloLogs.ps1 script.

If you have used a deployment manifest
file named something other than the default, specify it on the command line.
You may also specify an output folder where the collected log files will be
stored otherwise a .\logs subdirectory will
be used by default.

Examples:  
.\GatherOrleansSiloLogs.ps1

.\GatherOrleansSiloLogs.ps1
C:\Orleans\MyDeploy.xml

.\GatherOrleansSiloLogs.ps1
C:\Orleans\MyDeploy.xml C:\MyLogs

Removing Orleans

When it is time to remove an Orleans
deployment, use the UndeployOrleansSilos.ps1 script.

If you have used a deployment manifest
file named something other than the default, specify it on the command line.

Examples:  
.\UnDeployOrleansSilos.ps1

.\UnDeployOrleansSilos.ps1 C:\Orleans\MyDeploy.xml

时间: 2024-12-15 06:49:22

ORLEANS REMOTE DEPLOYMENT的相关文章

SPARK如何使用AKKA实现进程、节点通信

SPARK如何使用AKKA实现进程.节点通信 <深入理解Spark:核心思想与源码分析>一书前言的内容请看链接<深入理解SPARK:核心思想与源码分析>一书正式出版上市 <深入理解Spark:核心思想与源码分析>一书第一章的内容请看链接<第1章 环境准备> <深入理解Spark:核心思想与源码分析>一书第二章的内容请看链接<第2章 SPARK设计理念与基本架构> <深入理解Spark:核心思想与源码分析>一书第三章第一部分

Java RMI 入门案例

Java Remote Method Invocation(Java RMI) 是一个 Java API, 执行远程方法的调用,相当于 Remote Procedure Calls(RPC).Java RMI 支持直接传输序列化的 Java 类,以及分布式的垃圾回收. 案例概况 实现一个简单的 Java RMI 可通过以下四步骤: 1. 启动 rmiregistry 2. 定义服务接口,实现服务接口,通过 rmic 工具创建存根文件( stub ) 3. 实现服务端功能,并启动 4. 实现客户端

IBM云计算

云主机 "云"主机是“云”计算在基础设施应用上的重要组成部分,位于“云”计算产业链金字塔底层,产品源自“云”计算平台.简单点说,“云”主机就是多个服务器的集群,用户可以通过网络直接租用计算服务器,存储服务器,宽带资源等. 云计算 云计算(cloud computing)是一种按使用量付费的模式,这种模式提供可用的.便捷的.按需的网络访问,进入可配置的计算资源共享池,使用共享池中的资源.它具有如下特点: (一)   超大规模,IBM的“云”服务有几十万台服务器. (二)   可靠性强,多

XE6发布文件 在Deployment Manager中添加待发布的文件,Remote Path写入assets\internal\或assets\就可以

XE6发布文件 在Deployment Manager中添加待发布的文件,Remote Path写入assets\internal\或assets\就可以其中assets\internal\会把文件发布到TPath.GetDocumentsPath(也就是/data/data/.../files)目录下assets\会把文件发布到TPath.GetSharedDocumentsPath(也就是/mnt/sdcard/Android/data/.../files)目录下另外修改了System.St

[Java Web学习]Tomcat启动时报war exploded: Error during artifact deployment

报错:Artifact FirstWeb:war exploded: Error during artifact deployment. See server log for details. SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerorg.springframewor

ASP.NET: Web deployment task failed.

今晚部署遇到了两个问题. 一是一处由来已久的 bug,原因是我尝试了 DbContext Generator 然后又删掉了它,被提示:Please overwrite the replacement token '$edmxInputFile$' with the actual name of the .edmx file you would like to generate from Model1.tt解决方案很简单,重启 Visual Studio. 然后我们来说重头戏,错误描述为:Web

使用WebStorm/Phpstorm实现remote host远程开发

如果你的开发环境是在远程主机上,webstorm可以提供通过ftp/ftps/sftp等方式实现远程同步开发.这样我们可以就抛弃ftp.winscp等工具,通过webstorm编辑远程文件以及部署,本文基于WebStorm5.04编写, Intellij IDEA或者PHPStorm使用方法基本相同,可参考之.并且还要感谢因特里基友群群主大猫的帮助. 1.首先我们来创建一个基于远程主机的project,点击file>new project from existing sources,打开了创建p

Orleans的集群构建

Orleans的集群构建 这是Orleans系列文章中的一篇.首篇文章在此 听闻一周前,微软公布了.net core2.0,以及各种各样的其他core2.0.大家都很兴奋.微妈的诚意真是满满的.这次开源势头让我感觉到了微妈的技术实力之雄厚.我在这里祝福C#越来越好.细心的人似乎发现Orleans在github中是和net core分在一起的.Orleans的2.0何时发布呀- 现在我们面对的Orleans1.5(github上是1.6)已经是一个成熟的框架了.涉及到分布式的方方面面,我突然觉得我

Pycharm远程调试之ssh remote debug(二)

Pycharm远程调试之ssh remote debug (一) 上一篇我们讲了怎么去初步创建一个远程debug的工程,这篇我们来更深一下,讲一下当我们要修改Interperter时要怎么做. 1.创建一个工程,我们先将该工程使用local Interpreter,然后再把修改为remote Interpreter,看看我们需要怎么做(没那么简单的) 2.修改我们的Project Interpreter 为我们那好的remote Interpreter(在上一篇文章里) 3.添加Path map