简体   繁体   English

Azure存储模拟器无法初始化

[英]Azure storage emulator unable to initialize

I've upgraded Azure Storage Emulator from 2.3 to 2.4. 我已将Azure存储模拟器从2.3升级到2.4。 WAStorageEmulator.exe has been renamed to AzureStorageEmulator.exe but that's not the issue. WAStorageEmulator.exe已重命名为AzureStorageEmulator.exe,但这不是问题。

When I run 当我跑步

AzureStorageEmulator init -forcecreate

I simply get an error that Google returns with zero results: 我只是得到一个错误,Google返回了结果:

Error: User-specified instance not found. 错误:找不到用户指定的实例。 Please correct this and re-run initial ization. 请更正此问题,然后重新运行初始化。

Edit 编辑

I had to do a start and stop and then I was able to init. 我必须做一个开始和停止,然后才能初始化。 Because I had previous version of emulator installed I already have WAStorageEmulatorDb34 on my local SQL server instance. 因为安装了早期版本的模拟器,所以我的本地SQL Server实例上已经具有WAStorageEmulatorDb34 After I run init command I can see that no new database is being created (like WAStorageEmulatorDb42 ). 运行init命令后,可以看到没有创建新数据库 (例如WAStorageEmulatorDb42 )。

So I thought that the newest version may be using older DB. 因此,我认为最新版本可能正在使用较旧的数据库。 I then ran a query in MSSMS to check for existing blob containers and I can still see both containers I created on the older emulator containing blobs I added. 然后,我在MSSMS中运行了一个查询,以检查是否存在现有的Blob容器,但我仍然可以看到我在较旧的模拟器上创建的两个包含我添加的Blob的容器。

When I then accessed Development Azure Storage in Visual Studio it showed no containers whatsoever. 然后,当我在Visual Studio中访问Development Azure Storage时,它没有显示任何容器。 So the new version apparently doesn't use old DB. 因此,新版本显然不使用旧数据库。 But which one? 但是哪一个呢? And where is it ? 在哪里呢

Ok so I thought I'd run init one more time but with additional parameters to put DB on my SQL server instance: 好的,所以我想我应该再运行一次init,但是要使用其他参数将数据库放在我的SQL Server实例上:

AzureStorageEmulator init -server localhost -sqlinstance MSSQLSERVER -forcecreate

And then I get the aforementioned error. 然后我得到上述错误。 Again... 再次...

I'm running CMD as admin with elevated permissions. 我正在以提升权限的管理员身份运行CMD。

Solution that eventually worked 最终有效的解决方案

Additional info 附加信息

Azure Storage Emulator normally creates tables in the LocalDB storage. Azure存储模拟器通常在LocalDB存储中创建表。 Depending on the emulator version these may be in various DB instances. 根据模拟器的版本,它们可能在各种数据库实例中。 You can check each storage emulator version's configuration in 您可以在以下位置检查每个存储模拟器版本的配置:

 %USERPROFILE%\\AppData\\Local\\[AzureStorageEmulatorFolder]\\*.config 

Different versions have different folder names from DevelopmentStorage , WAStorageEmulator to latest (4.2) AzureStorageEmulator . DevelopmentStorageWAStorageEmulator到最新的(4.2) AzureStorageEmulator ,不同的版本具有不同的文件夹名称。

In this subfolder you'll find at least one config file that will correspond to your installed Azure storage emulator's version. 在此子文件夹中,您将找到至少一个与已安装的Azure存储模拟器的版本相对应的配置文件。 If you open it, you'll see how it's configured and where it saved its tables. 如果打开它,您将看到它的配置方式以及它保存表的位置。 This is also true if you create initialization on any existing full SQL server instance. 如果您在任何现有的完整SQL Server实例上创建初始化,也是如此。

The problem when I was trying to initialize my Azure Storage Emulator (ASE) is that I was also providing SQL server's instance which is the default one (MSSQLSERVER). 尝试初始化Azure存储模拟器(ASE)时出现的问题是,我还提供了SQL Server实例(默认实例)(MSSQLSERVER)。 I shouldn't be providing this information in the first place but only provide information about server 我不应该首先提供此信息,而仅提供有关服务器的信息

So the correct command line call is 所以正确的命令行调用是

AzureStorageEmulator init -server localhost -forcecreate

This created my database on my local SQL server. 这在本地SQL服务器上创建了数据库。 From here on, it's up to you how you'll migrate from an existing ASE database (if you already had one before) to the new one. 从这里开始,由您决定如何从现有的ASE数据库(如果您以前已有数据库)迁移到新数据库。

The issue I ran into is more or less an user error. 我遇到的问题或多或少是用户错误。

Azure Storage Emulator 4.6 Azure存储模拟器4.6

Error : User-specified instance not found. 错误:找不到用户指定的实例。 Please correct this and re-run initialization. 请更正此问题,然后重新运行初始化。

and

Resolution : I didn't have a windows authenticated login to my local sql instance. 解决方法:我没有Windows身份验证登录到本地sql实例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM