问题
I have a HighlyAvailable AppFabric cache setup across 3 servers (AppFabric 1.1). I want to monitor the local cache on each server and, if it is down for any reason start it back up.
Problem
The problem is permissions - I wrote a Powershell script to do this, and it works great if I run while logged in or set up a Scheduled Task to run it as me - but I am an administrator on all machines. If I try running this script with a service user, it fails. I don't want to make my service user an administrator on all 3 machines.
Questions
- Is there a way to get this working without running it as an administrator? Has anybody else done this?
- Is there another way to monitor these caches and restart them if they die? I am happy to throw away my powershell script (ok not happy, but I will :).
Additional Detail
I know I can log onto the server and run 'Caching Administration Windows PowerShell' as Administrator, then issue the following commands to check the status of the local node:
Get-CacheHost localhost 22233
Then, if it is down issue the following command to start it:
Start-CacheHost localhost 22233
So, I wrote a powershell script to do this. It works great, other than the permissions issues mentioned above. I haven't shown the script because it isn't really pertinent to this convo, but I will share if it helps.
回答1:
Directly without admin, not really possible is there some reason that you could not run your powershell monitoring script as a scheduled windows task?
回答2:
As per the note mentioned in http://msdn.microsoft.com/en-us/library/hh351453(v=azure.10).aspx I believe it is not possible to start a cacheHost unless you are an Administrator on the machine.
来源:https://stackoverflow.com/questions/19987451/monitoring-appfabric-cache