子网内的Azure负载平衡器(Azure load balancer inside a subnet)
我有一个带有子网的VNET,子网中有3个虚拟机,VNET通过VPN连接连接到本地服务器。 本地服务器将向子网的内部IP发送请求。
我想要做的是托管一个没有公共IP的负载均衡器,但在子网范围内有一个IP。 然后,本地应用程序将与单个负载平衡器进行通信,然后将该请求转发到托管子网中应用程序的任何服务器。
任何人都可以告诉我,如果这是可能的,或者如果可能的话替代。
I have a VNET with a subnet, there are 3 VMs in the subnet, the VNET is connected via a VPN connection to an on-premises server. The on-premises server will send requests to an internal IP of the subnet.
What I'd like to do is host a load balancer with no public IP, but has an IP in the subnet range. The on-premises app would then talk to the single load balancer, which would in turn forward the request on to any of the servers hosting my app in the subnet.
Can anyone tell me if this is possible, or an alternative if possible.
原文:https://stackoverflow.com/questions/50129629
最满意答案
sort
是一种基于行的工具,因此在调用它之前不能删除换行符。 但是,您可以用数据排序后的空格替换它们,例如tr
:re='^[0-9]+$' if ! [[ $1 =~ $re ]] ; then echo "error: Not a number" >&2; exit 1 else printf "%s\n" $@ | sort -n | tr '\n' ' ' fi
sort
is a line-based tool, so you can't remove the linefeeds before you call it. You can however replace them with spaces once the data is sorted, for example withtr
:re='^[0-9]+$' if ! [[ $1 =~ $re ]] ; then echo "error: Not a number" >&2; exit 1 else printf "%s\n" $@ | sort -n | tr '\n' ' ' fi
相关问答
更多-
git:gitk有“按日期排序”的命令行选项吗?(git: Is there a command line option for “Sort by date” for gitk?)[2023-08-14]
至少有人提到man gitk采用与git rev-list相同的选项,其中包括 --date-order 这个选项类似于--topo-order ,因为没有父节点在它的所有子节点之前,但是除此之外,仍然按照提交时间戳顺序排序。 有关更多信息,请参阅“ 了解gitk指南? ”。 注意:如果-d或--date-order实际上是你之后的参数,那么最好不要使用太多,根据Linus自己(来自lists-archives.com/git或www.spinics.net/lists/git/ ) : 事情是, -- ... -
不,你不能...... 但您可以使用相同名称的命令行参数覆盖pom.xml中的属性 No, you can't.. But you can override the properties in your pom.xml with command line parameters by the same name
-
将评论转录成答案 使用getopt() ,然后检查它与optarg是一位数字( strlen(optarg) == 1 && isdigit(optarg[0]) )。 临时参数解析将引导您进入各种临时问题。 我如何确保它在“-f”选项之后,但是...... 您可以编写类似于以下内容的代码: int opt; while ((opt = getopt(argc, argv, "f:")) != -1) { switch (opt) { case 'f': if (st ...
-
命令行参数 - PHP(Command Line arguments - PHP)[2022-02-14]
exit(1)将始终被调用,因为它在if语句之外。 尝试这个: 3 || $argc < 3) { print 'Invalid Arguments'; exit(1); } else { print larger($argv[1],$argv[2]); exit(0); } exit(1) will alw ... -
在命令行中排序数字(Sorting number in command line)[2023-05-06]
sort是一种基于行的工具,因此在调用它之前不能删除换行符。 但是,您可以用数据排序后的空格替换它们,例如tr : re='^[0-9]+$' if ! [[ $1 =~ $re ]] ; then echo "error: Not a number" >&2; exit 1 else printf "%s\n" $@ | sort -n | tr '\n' ' ' fi sort is a line-based tool, so you can't remove the linefeeds ... -
就像是: my $loopLimit = 1; # default if ($#ARGV >= 1) { for ($i = 1; $i <= $#ARGV; $i++) { if ($ARGV[$i] =~ /^\-/) { if ($ARGV[$i] =~ /\-test/) { # do something } elsif ($ARGV[$i] =~ /\-L(\d+)/) # -L followed b ...
-
在python中,您可以通过sys访问参数。 做就是了: import sys print sys.argv 它应该以正确的顺序显示所有参数,事实是你将在argv列表中有文件名,这是坏的! 因此,你可以删除它 numbers = sys.argv[1:] 没有第一个元素的副本。 然后,您可以通过此代码对元素进行排序: print sorted(numbers, key=lambda x: float(x)) 它的作用是对元素进行排序,但不是考虑元素本身,而是对它们的浮点值进行排序。 然后您的脚本可以 ...
-
在C ++中排序命令行参数(Sort command line args in C++)[2022-11-18]
使用自定义比较器从尝试std::sort std::sort(argv, argv + argc, [](char * const & a, char * const & b) { return atoi(a) < atoi(b); }); Try std::sort from with a custom comparator std::sort(argv, argv + argc, [](char * const & a, char * const ... -
如何使用pthread通过命令行接受线程数?(how number of thread should be accepted via command line using pthread?)[2022-08-05]
在C中,你通过让main取两个参数来处理命令行参数, int main(int argc, char** argv) 其中argc是命令行参数的数量(包括程序本身), argv是指向内存位置的指针,其中argc-1指向具有实际参数的字符串。 例: int main(int argc, char** argv) { printf("The program was executed as %s.\n", argv[0]); printf("The arguments were:\n"); for ... -
为了测试下面的批处理代码,我用以下行创建了Input.txt文件: No value provided for Subject Attribute ST, skipped RequestId: 1892 RequestId: "1892" Certificate request is pending: Taken Under Submission (0) Generating certificate request and key for xxxx No value provided for Subject ...