我们的应用程序使用 Azure 服务总线进行消息传递。我们创建了几个主题和订阅者。我们每天将发送大约 500 条消息,但在图中它显示了对 500 条消息的数十万个请求。我们的计费价格也是每月 800 美元左右。这对于 500 * 30 条消息来说太多了。我不明白为什么价格这么高,而且我想知道图中的请求是什么意思?。
如果价格的原因是因为请求数量,那么我该如何减少请求数量?。我正确看到的消息。问题仅在于请求。
如果我使用kubectl从id_rsa文件创建一个秘密:
kubectl create secret generic hcom-secret --from-file=ssh-privatekey=./.ssh/id_rsa
Run Code Online (Sandbox Code Playgroud)
然后将秘密装入容器中
"volumeMounts": [
{"name": "cfg", "readOnly": false, "mountPath": "/home/hcom/.ssh"}
]
"volumes": [
{"name": "cfg", "secret": { "secretName": "hcom-ssh" }}
],
Run Code Online (Sandbox Code Playgroud)
结果文件不是id_rsa,而是ssh-privatekey,其上的许可证不是ssh所期望的600
这是一种正确的方法,还是有人可以详细说明应该如何做到这一点?
在我今天的活动中,我在azure中创建测试vm然后将其删除.出于某种原因,这次我计划创建100个测试vms,我想实现一个调度机制(通过powershell或AzureRunbook),以便创建的服务器可以在30天后自动删除...
问题是我可以使用Powershell找出创建的云服务日期,但不能创建VM的创建日期.很少有云服务包含我不想删除的旧虚拟机.
我正在考虑vm的不同命名约定,以便我可以使用它来删除时间 -
if($vm.name -like "mypattern*")
{
$out1 = $vm.Name
$out2 = $vm.ServiceName
Remove-AzureVM -Name $out1 -ServiceName $out2 -DeleteVHD
sleep -Seconds 60
}
Run Code Online (Sandbox Code Playgroud)
我相信除此之外必须有更多的方法.什么可以替代选择.我更喜欢powershell.
我试图触发一个PowerShell工作流程,它应该并行旋转10个线程.我正在使用PS版本4.代码 -
Workflow CreateVMs
{
$i = 0
#somecodehere...
foreach -parallel -throttlelimit 10($i in 0..30)
{
#somemorecodehere...
# INVOKING BATCH FILE USING POWERSHELL
}
}
Run Code Online (Sandbox Code Playgroud)
我在内联脚本中使用powershell调用批处理文件.我在任务管理器中观察到的是,一次只有5个线程处于活动状态 -
可能是下一个获取的线程只有五个中的一个完成.我从未见过超过5 ps的实例.但是,当我检查每个用户允许的ps会话时,它远远超过5.
如何在PS工作流程中并行旋转10个PS线程.我在这里错过了什么?
我需要将vhds从一个订阅移动到另一个订阅.我想知道哪一个是更好的选择:Start-AzureStorageBlobCopy或AzCopy?
哪一个花费较少的时间?
在powershell中,我通过调用上下文来验证它是否存在.
New-AzureStorageContext -StorageAccountName "testdisks401" -StorageAccountKey "...."
Run Code Online (Sandbox Code Playgroud)
结果
StorageAccountName : testdisks401
BlobEndPoint : https://testdisks401.blob.core.windows.net/
TableEndPoint : https://testdisks401.table.core.windows.net/
QueueEndPoint : https://testdisks401.queue.core.windows.net/
FileEndPoint : https://testdisks401.file.core.windows.net/
Context : Microsoft.WindowsAzure.Commands.Common.Storage.AzureStorageContext
Name :
StorageAccount : BlobEndpoint=https://testdisks401.blob.core.windows.net/;QueueEndpoint=https://testdisks401.queue.core.windows.net/;TableEndpoint=https://testdi
sks401.table.core.windows.net/;FileEndpoint=https://testdisks401.file.core.windows.net/;AccountName=testdisks401;AccountKey=[key hidden]
EndPointSuffix : core.windows.net/
Run Code Online (Sandbox Code Playgroud)
当我尝试在这里设置它时:
Set-AzureSubscription -SubscriptionName 'XXXX' -CurrentStorageAccount "testdisks401"
Run Code Online (Sandbox Code Playgroud)
我明白了
Set-AzureSubscription : ResourceNotFound: The storage account 'testdisks401' was not found.
At line:1 char:1
+ Set-AzureSubscription -SubscriptionName 'XXX
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Set-AzureSubscription], CloudException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.SetAzureSubscriptionCommand
Run Code Online (Sandbox Code Playgroud)
被困了好一阵子.我基本上想编写一个shellcript来从现有的操作系统光盘创建一个VM.我设法使用powershell创建现有光盘的副本(使用第一个命令的上下文使其工作).但现在我正在尝试使用以下方法创建VM配置:
$vmI1 = New-AzureVMConfig -Name "TestRecover" -InstanceSize Small …Run Code Online (Sandbox Code Playgroud) 我只想选择 .xls 和 .xlsx 文件,但我无法选择任何类型的文件。任何人都可以向我建议任何代码,或者任何人都可以对我现有的代码进行更改吗?提前致谢。
public class Convertor {
public static void main(String[] args) {
JFileChooser chooser = new JFileChooser();
chooser.setCurrentDirectory(new java.io.File("."));
chooser.setDialogTitle("choosertitle");
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
chooser.setAcceptAllFileFilterUsed(false);
if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
System.out.println("getCurrentDirectory(): " + chooser.getCurrentDirectory());
System.out.println("getSelectedFile() : " + chooser.getSelectedFile());
} else {
System.out.println("No Selection ");
}
}
}
Run Code Online (Sandbox Code Playgroud) azure ×4
powershell ×2
excel ×1
filechooser ×1
java ×1
jfilechooser ×1
kubernetes ×1
servicebus ×1
ssh ×1