AppFabric无法创建DataCache(LMTRepopulationJob FAILS)

时间:2015-10-03 00:59:23

标签: sharepoint-2013 appfabric appfabric-cache distributed-cache datacachefactory

首先,我正在学习sharepoint 2013,我一直在学习一些教程,到目前为止我只是设置了一个农场,除了每5个登录到事件查看器的服务外,一切似乎都正常工作。分:

  

作业定义的执行方法   Microsoft.Office.Server.UserProfiles.LMTRepopulationJob(ID   1e573155-b7f6-441b-919b-53b2f05770f7)引发了异常。更多   信息包含在下面。

     

FeedCacheService.BulkLMTUpdate中的意外异常:无法执行   创建一个DataCache。 SPDistributedCache可能已关闭..

我发现这是一个配置为每5分钟执行一次的工作

enter image description here

但是关于SPDistributedCache可能已关闭的假设,我已经验证了它并且它正在运行

enter image description here

enter image description here

正如您所看到的,它实际上正在运行,我也通过SP powershell(get-cachehostget-cacheclusterhealth)检查了主机缓存,但仍然看起来都很好

enter image description here

然而,当我执行命令get-cache时,我只获得了默认值,而对于我所读到的内容,应该列出另一种缓存类型,如:

DistributedAccessCache_XXXXXXXXXXXXXXXXXXXXXXXXX DistributedBouncerCache_XXXXXXXXXXXXXXXXXXXXXXXX DistributedSearchCache_XXXXXXXXXXXXXXXXXXXXXXXXX DistributedServerToAppServerAccessTokenCache_XXXXXXX DistributedViewStateCache_XXXXXXXXXXXXXXXXXXXXXXX

其中我认为可能应该包括DataCache

enter image description here

到目前为止,我已经尝试了一些解决方法,但没有成功

Restart-Service AppFabricCachingService
Remove-SPDistributedCacheServiceInstance
Add-SPDistributedCacheServiceInstance
Restart-CacheCluster

即使是这个脚本似乎也可以在很多情况下修复AppFabric缓存服务

$SPFarm = Get-SPFarm
$cacheClusterName = "SPDistributedCacheCluster_" + $SPFarm.Id.ToString()
$cacheClusterManager = [Microsoft.SharePoint.DistributedCaching.Utilities.SPDistributedCacheClusterInfoManager]::Local
$cacheClusterInfo = $cacheClusterManager.GetSPDistributedCacheClusterInfo($cacheClusterName);
$instanceName ="SPDistributedCacheService Name=AppFabricCachingService"
$serviceInstance = Get-SPServiceInstance | ? {($_.Service.Tostring()) -eq $instanceName -and ($_.Server.Name) -eq $env:computername}
$serviceInstance.Delete()
Add-SPDistributedCacheServiceInstance
$cacheClusterInfo.CacheHostsInfoCollection

如果有人有任何建议,我将非常感谢,提前谢谢你!

3 个答案:

答案 0 :(得分:1)

这是一般性错误消息,意味着真正的问题未知(因此“可能”一词)。

我认为解决这个问题的关键在于它不是可能的,就是在ULS日志中查找之前发生的事件。类型为“Unexpected”的事件不会出现在事件日志中,并且经常出现在一般类型的错误之前。

在许多情况下,您可能会看到类似“未找到文件”的内容。这通常意味着所提到的文件不在程序集缓存中。由于分布式缓存利用了Sharepoint之外的AppFabric,因此Sharepoint找到它的文件的唯一方法是查看程序集缓存。 sharepoint预安装程序应该将文件放在那里,但它可能已经失败,或者有人卸载了App Fabric并重新安装了它,这将从程序集中删除文件而不是将它们放回去。

答案 1 :(得分:1)

Restart-CacheCluster之前,您可以指定与SharePoint数据库的连接(目录名称可能不同)

Use-CacheCluster -ConnectionString "Data Source=(SharePoint DB Server)
\\(Optional Instance);Initial Catalog=CacheClusterConfigurationDB;
Integrated Security=True" -ProviderType System.Data.SqlClient

注意:它不会永久工作

注2:如果您在数据库服务器上没有命名实例,只需将服务器名称放在" \"。

如果您没有目录,可以按照此脚本

***
Remove-Cache default
New-Cache SharePointCache
Get-CacheConfig SharePointCache
Set-CacheConfig SharePointCache -NotificationsEnabled True
***
New-CacheCluster -Provider System.Data.SqlClient -ConnectionString  "Data     Source=(SharePoint DB Server)\\(Optional Instance);Initial Catalog=CacheClusterConfigurationDB;Integrated Security=True" -Size Small

Register-CacheHost -Provider System.Data.SqlClient -ConnectionString  "Data Source=(SharePoint DB Server)\\(Optional Instance);Initial Catalog=CacheClusterConfigurationDB;Integrated Security=True"  -Account "Domain\spservices_account" -CachePort 22233 -ClusterPort 22234  -ArbitrationPort 22235 -ReplicationPort 22236 -HostName  [Name_of_your_server]

Add-CacheHost -Provider System.Data.SqlClient -ConnectionString  "Data Source=(SharePoint DB Server)\\(Optional Instance);Initial Catalog=CacheClusterConfigurationDB;Integrated Security=True" -Account "Domain\spservices_account"

Add-CacheAdmin -Provider System.Data.SqlClient -ConnectionString  "Data Source=(SharePoint DB Server)\\(Optional Instance);Initial Catalog=CacheClusterConfigurationDB;Integrated Security=True" 

Use-CacheCluster

您可以在regedit中指定或检查数据库配置

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppFabric\V1.0\Configuration

查找ConnectionString字符串值,并设置连接字符串

Data Source=(SharePoint DB Server)\(Optional Instance);Initial Catalog=CacheClusterConfigurationDB;Integrated Security=True

要查询您可以使用的服务器的状态:

Get-SPServiceInstance | ? {($_.service.tostring()) -eq “SPDistributedCacheService Name=AppFabricCachingService”} | select Server, Status
Get-SPServer | ? {($_.ServiceInstances | % TypeName) -contains "Distributed Cache"} | % Address
Get-AFCache | Format-Table –AutoSize
Get-CacheHost

aditional的: 如果您需要更改服务帐户,可以执行以下步骤:

$f = Get-SPFarm
$svc = $f.Services | ? {$_.Name -eq "AppFabricCachingService"}
$acc = Get-SPManagedAccount -Identity "Domain\spservices_account"
$svc.ProcessIdentity.CurrentIdentityType = "SpecificUser"
$svc.ProcessIdentity.ManagedAccount = $acc
$svc.ProcessIdentity.Update()
$svc.ProcessIdentity.Deploy()

答案 2 :(得分:0)

您是否从场帐户更改了分布式缓存帐户? 你打算用什么编号? 这是一个服务器场吗?

离开我的头顶,唯一剩下的就是:

Grant-CacheAllowedClientAccount -Account“domain \ ProfileserviceWebAppIdentity”

我会执行iisreset并在运行此命令后重新启动owstimer服务。

相关问题