尝试连接时(使用Ignition.GetIgnite())获取“无法获取默认 Ignite 实例:没有启动实例。 ” 。
更多信息:
我正在尝试使用 Apache Ignite 作为我的内存数据库。我的计划是在服务器中启动 Ignite 实例,然后让应用程序连接到该实例。我使用默认配置从命令行启动 apache ignite
ignite.bat
然后,从我的 .NET 应用程序中,我尝试 GetIgnite 以便它连接/附加现有的 ignite 节点,因为两者都在我的本地计算机中。
var ignite = Ignition.GetIgnite();
这是我在 web.config 中的配置
<configSections>
<section name="igniteConfiguration" type="Apache.Ignite.Core.IgniteConfigurationSection, Apache.Ignite.Core" />
</configSections>
<igniteConfiguration xmlns="http://ignite.apache.org/schema/dotnet/IgniteConfigurationSection"
localhost="127.0.0.1" peerAssemblyLoadingMode="CurrentAppDomain">
<atomicConfiguration atomicSequenceReserveSize="10" />
</igniteConfiguration>
工作版本: 我可以从应用程序中启动“Ignite”并执行内存数据库操作,例如使用不同的 ICache 缓存数据,然后加入以检索数据。但是这个版本将无法扩展。
//for some reason I have to set the environment variable like this
Environment.SetEnvironmentVariable("IGNITE_HOME", "C:\\test\app\\packages\\Apache.Ignite.2.4.0\\");
// Start Ignite and retrieve cache
_ignite = Ignition.StartFromApplicationConfiguration();
CacheConfiguration config = new CacheConfiguration("MyProduct", typeof(MyProduct));
config.CacheMode = CacheMode.Local;
ICache productList = _ignite.GetOrCreateCache<string, MyProduct>
(config);
隔江千里
相关分类