是否有人成功地让Memurai作为哨兵运行?在来自他们网站的指示之后,即使存在哨兵标志,memurai.exe --service-install --service-name "memurai-sentinel" --sentinel memurai-sentinel.conf也会生成sentinel directive while not in sentinel mode。去掉服务标志,它将作为一个哨兵运行,没有问题。
发布于 2020-06-24 17:47:00
Memurai团队刚刚发布了2.0.1版本,它修复了作为服务运行的问题。请访问https://www.memurai.com/get-memurai以获得持续的开发人员构建。
发布于 2020-06-22 18:14:02
在下一个版本中,Memurai团队应该会修复这个问题。编辑:在memurai2.0.1发行版中已经修复了这个问题。
同时,这里有一个使用PowerShell脚本通过其他方式在Windows上添加哨兵服务的解决方案:
样本sentinel.conf
# Copy this file to C:\sentinelconf\sentinel.conf
logfile "C:\sentinelconf\sentinel.log"
port 5000
sentinel monitor mymaster 127.0.0.1 6379 1
sentinel down-after-milliseconds mymaster 60000
sentinel failover-timeout mymaster 180000
sentinel parallel-syncs mymaster 1sentinel_script.ps1文件:
# Full path of installed memurai.exe
$MemuraiBinPath="C:\Program Files\Memurai\memurai.exe"
# Full path of sentinel.conf
$SentinelConfPath="C:\sentinelconf\sentinel.conf"
# Full path of sentinel.log
$SentinelLogPath="C:\sentinelconf\sentinel.log"
# Desired name of the service
$SentinelServiceName="Memurai Sentinel"
# Get Network Service credentials
$NetworkServiceCredentials = New-Object -TypeName System.Management.Automation.PSCredential ("NT AUTHORITY\NETWORK SERVICE", (New-Object System.Security.SecureString))
# Create a service to start Memurai in Sentinel mode
New-Service -Name $SentinelServiceName -Credential $NetworkServiceCredentials -BinaryPathName "`"$MemuraiBinPath`" --service-run `"$SentinelConfPath`" --sentinel"
# Create a rule to give the Network Service account access to the paths.
$SentinelAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("NT AUTHORITY\NETWORK SERVICE", "FullControl", "ContainerInherit,ObjectInherit", "None", "Allow")
# Get the path where the sentinel.conf file is located and add permissions.
$SentinelConfFolderPath = Split-Path $SentinelConfPath
$ConfPathAccessPermissions = Get-Acl $SentinelConfFolderPath
$ConfPathAccessPermissions.SetAccessRule($SentinelAccessRule)
Set-Acl $SentinelConfFolderPath $ConfPathAccessPermissions
# Get the path where the sentinel.log file is located and add permissions.
$SentinelLogFolderPath = Split-Path $SentinelLogPath
$LogPathAccessPermissions = Get-Acl $SentinelLogFolderPath
$LogPathAccessPermissions.SetAccessRule($SentinelAccessRule)
Set-Acl $SentinelLogFolderPath $LogPathAccessPermissions
# Start the Memurai Sentinel service.
Start-Service $SentinelServiceName
Write-Host "Started the $SentinelServiceName service."https://stackoverflow.com/questions/62471127
复制相似问题