我在ServiceDefinition文件中创建了一个具有以下WorkerRole元素的辅助角色。我已将整个C:\ Program Files(x86)\ MySQL \ MySQL Server 5.5文件夹复制到直接位于worker角色文件夹下的文件夹中,当我运行cspack时,它的名称是mysql,csrun启动模拟器,但它启动并停止角色,有时它会说odbs @ localhost的访问被拒绝但它不起作用。谢谢你的帮助
<WorkerRole enableNativeCodeExecution="true" name="MyPhpProj_MyWorkerRole" vmsize="Small">
<LocalStorage name="E2EStorage" cleanOnRoleRecycle="false" />
<Endpoints>
<InternalEndpoint name="PeerEndpointIn" protocol="tcp" />
<InternalEndpoint name="MasterElectionService" protocol="tcp" />
<InternalEndpoint name="MySQL" protocol="tcp" />
<InternalEndpoint name="InstanceManagerEndpontIn" protocol="tcp" />
</Endpoints>
<Runtime executionContext="limited">
<EntryPoint>
<ProgramEntryPoint commandLine="./mysql/bin/mysql.exe" setReadyOnProcessStart="true" />
</EntryPoint>
</Runtime>
<Imports/>
<LocalResources>
<LocalStorage cleanOnRoleRecycle="false" name="MySQL" sizeInMB="260"/>
<LocalStorage cleanOnRoleRecycle="false" name="MySQLDatastore" sizeInMB="20"/>
</LocalResources>
<ConfigurationSettings>
<Setting name="InitFile"/>
<Setting name="LogLevel"/>
<Setting name="ScheduledTransferPeriodInSeconds"/>
<Setting name="WindowsAzureStorageConnectionString"/>
</ConfigurationSettings>
</WorkerRole>
答案 0 :(得分:1)
如果你的问题是随机的,有时是工作而不是其他工作,我真的不知道发生了什么,因为它不应该发生。如果存在一些配置或访问问题,问题将始终如一。
当我在我的worker角色中运行MySQL时,我有一个批处理脚本,我在其中添加了一个具有管理员权限的新用户,并在该用户权限访问下启动了MySql,所以
我会将提升与ProgramEntryPoint一起使用,如下所示:
<Runtime executionContext="elevated">
<EntryPoint>
<ProgramEntryPoint commandLine="./mysql/bin/mysql.exe" setReadyOnProcessStart="true" />
</EntryPoint>
</Runtime>