5

我已将 RavenDB 2.5.0 安装为 Windows 服务。当我尝试以管理员身份运行 Raven.Server.exe 时,我收到以下信息:

Trying to revoke rights for http.sys
runas netsh http delete urlacl url=https://+:8080/
Trying to grant rights for http.sys
runas netsh http add urlacl url=http://+:8080/ user="Endri-PC\Endri"
Failed to grant rights for listening to http, exit codes: (1 and 1)
A critical error occurred while starting the server. Please see the exception de
tails bellow for more details:
System.InvalidOperationException: Could not write to location: C:\RavenDB\Databa
se\System. Make sure you have read/write permissions for this path. ---> Microso
ft.Isam.Esent.Interop.EsentFileAccessDeniedException: Cannot access file, the fi
le is locked or in use
   at Raven.Storage.Esent.TransactionalStorage.Initialize(IUuidGenerator uuidGen
erator, OrderedPartCollection`1 documentCodecs)
   --- End of inner exception stack trace ---
   at Raven.Storage.Esent.TransactionalStorage.Initialize(IUuidGenerator uuidGen
erator, OrderedPartCollection`1 documentCodecs)
   at Raven.Database.DocumentDatabase..ctor(InMemoryRavenConfiguration configura
tion, TransportState transportState)
   at Raven.Server.RavenDbServer..ctor(InMemoryRavenConfiguration settings)
   at Raven.Server.Program.RunServerInDebugMode(RavenConfiguration ravenConfigur
ation, Boolean launchBrowser)
   at Raven.Server.Program.RunInDebugMode(Nullable`1 anonymousUserAccessMode, Ra
venConfiguration ravenConfiguration, Boolean launchBrowser, Boolean noLog)
   at Raven.Server.Program.<>c__DisplayClass34.<InteractiveRun>b__1b()
   at Raven.Server.Program.InteractiveRun(String[] args)
   at Raven.Server.Program.Main(String[] args)
Press any key to continue...

知道该怎么做吗?

4

2 回答 2

10

我在关注 RavenDB 文档的“基本概念”部分时遇到了同样的问题,输出如下:

C:\RavenDB>Raven.Server.exe
Trying to grant rights for http.sys
runas netsh http add urlacl url=http://+:8080/ user="User-PC\User"
Failed to grant rights for listening to http, exit codes: (0 and 1)
A critical error occurred while starting the server. Please see the exception details bellow for more details:
System.InvalidOperationException: Could not write to location: C:\RavenDB\Data.
Make sure you have read/write permissions for this path. ---> Microsoft.Isam.Esent.Interop.EsentFileAccessDeniedException: Cannot access file, the file is locked or in use
<stack trace follows>

问题是 RavenDB 安装程序已自动将 RavenDB 服务器作为 Windows 服务启动,从而阻止命令行 Raven.Server.exe 能够访问正确的目录。我刚刚打开了服务控制面板(开始菜单 -> services.msc)并停止了 RavenDB 服务。之后,从命令行启动 Raven.Server.exe 就像文档中演示的那样工作。

请注意,这是在具有 RavenDB 2.5.2851 的开发模式下的 Windows 7 x64 Professional 计算机上运行的。

于 2014-04-04T15:38:59.623 回答
0

您既没有访问 8080 端口的权限,也没有访问数据库文件夹的权限。如果您想在您的帐户上运行 RavenDB,请授予自己对该文件夹的权限C:\RavenDB\Database\System并在提升的控制台中运行此命令:

netsh http 添加 urlacl url=http://+:8080/

于 2014-02-10T13:37:14.633 回答