如何指定本地开发人员的服务结构集群的创建位置? [英] How can I specify where my local developer's service fabric cluster is created?

查看:46
本文介绍了如何指定本地开发人员的服务结构集群的创建位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题:我正在学习Service Fabric,并且正在做简单的教程,并且本地群集正在填充我的C驱动器.我在Visual Studio中运行项目.它首先在文件夹SfDevCluster中创建一个群集.占用842 MB空间.然后,它部署服务和Web API站点.请记住,这些都是琐碎的教程,几乎没有内容.现在,我注意到我有一个文件夹,其大小为1.22 TB,磁盘上的大小为9.4 GB.我不确定如何解释.但这会占用C驱动器上的剩余空间并触发警报. 我还有其他具有大量空间的驱动器.我希望指定使用那些.有没有一种方法可以使用Visual Studio使用的服务结构群集来做到这一点?还是有办法限制过于雄心勃勃的规模分配?如果您了解这一点,能否解释这些不寻常的文件夹大小是什么意思? 在过去,我会拥有大量空间的硬盘驱动器.但是现在,我的开发人员机器具有更快,但更昂贵的SSD驱动器,而且空间非常宝贵.因此,我需要对群集位置进行更多控制.

My problem: I am learning Service Fabric, and doing simple tutorials, and the local cluster is filling up my C drive. I run the projects in Visual Studio. It first creates a cluster in a folder SfDevCluster. That takes up 842 MB of space. Then it deploys the services and web api sites. Remember, these are trivial tutorials with almost nothing in them. Now, I notice that I have a folder with a Size = 1.22 TB and Size on Disk of 9.4 GB. I'm not sure how to interpret that. But it consumes the remaining space on my C drive and sets off alarms. I have other drives with lots of space. I would love to specify that those be used. Is there a way to do that with the service fabric cluster used by Visual Studio? Or is there a way to constrain the overly ambitious size allocations? And if you understand this, can you explain what these unusual folder sizes mean? In the old days, I would have a hard drive with lots of space. But now, my developer machine has a much faster, but more expensive SSD drive, and space is at a premium. So I need more control of the cluster location.

推荐答案

您可以通过在PowerShell中运行DevClusterSetup脚本来设置指向非系统驱动器的本地群集.您可以在%programfiles%\Microsoft SDKs\Service Fabric\ClusterSetup\下找到该脚本.您想要的命令行是:

You can set up a local cluster pointing to a non-system drive by running the DevClusterSetup script in PowerShell. You can find the script under %programfiles%\Microsoft SDKs\Service Fabric\ClusterSetup\. The command line you want is:

.\DevClusterSetup.ps1 -PathToClusterDataRoot <desired_app_and_data_location> -PathToClusterLogRoot <desired_tracelog_location>

如果您已经在运行集群,则此脚本将删除它并创建一个新的集群(请注意,这将删除所有已部署的应用程序及其数据).新群集运行后,Visual Studio将在本地部署时自动使用它.

If you already have a cluster running, this script will remove it and create a new one (note that this will delete any deployed apps and their data). Once you have the new cluster running, Visual Studio will automatically use that when you deploy locally.

关于文件大小-这主要归因于用于复制存储在可靠集合中的状态的日志文件. 稀疏文件是预先分配的,这就是为什么您看到磁盘大小与大小之间存在差异的原因.我们正计划使这些值可配置,以便可以在本地群集上对其进行拨号.

As for the file sizes - this is mostly due to the log file used for replication of state stored in reliable collections. A large, sparse file is preallocated up-front, which is why you see a difference between size and size on disk. We are planning to make these values configurable so that they can be dialed down on local clusters.

这篇关于如何指定本地开发人员的服务结构集群的创建位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆