2012-06-15 30 views
0

我已经在ServiceDefinition文件中使用以下WorkerRole元素创建了一个辅助角色。我将C:\ Program Files文件(x86)\ MySQL \ MySQL Server 5.5文件夹复制到一个名为mysql的worker角色文件夹下的文件夹中,当我运行cspack和csrun时,它启动了模拟器,但它启动并停止角色,它有时不工作,它说拒绝访问@ localhost但是。感谢您的帮助通过工作角色在Windows Azure上安装mysql

<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> 

回答

1

如果你的问题是随机的像作品的某个时候,而不是其他的工作,我真的不知道发生了什么,因为它不应该发生。如果有一些配置或访问问题,问题将始终如此。

当我在我的辅助角色跑的MySQL我有我在其中添加具有管理员权限的新用户批处理脚本,并与ProgramEntryPoint根据该用户权限的访问开始的MySQL所以

我会用高架为如下:

<Runtime executionContext="elevated"> 
    <EntryPoint> 
    <ProgramEntryPoint commandLine="./mysql/bin/mysql.exe" setReadyOnProcessStart="true" /> 
    </EntryPoint> 
</Runtime> 
+0

谢谢你的回答,所以你认为我所做的是对的。我可以让它工作,我只是想说它有时会产生错误。我只想确保我在WA上安装MySql所做的是正确的。 – user217648

+0

是的,你已经做得非常正确。您也可以将RDP添加到您的实例,然后验证MySql实例是否正在运行,并且您是否可以运行相同的脚本来验证连接。 – AvkashChauhan

+0

我放弃使用EntryPoint和Mysql.exe,因为我总是得到相同的错误(odbc访问被拒绝),我不知道如何创建您所谈论的批处理文件。相反,我使用eclipse来创建一个dll的工作者角色,并且我在cspack命令中添加了入口点到该dll。现在当我去计算模拟器显示绿色和以下复制文件夹mysql \数据到C:/Users/ksaleh.CORP/AppData/Local/dftmp/Resources/60df05e6-005a-46ac-ae22-eedb22f178cc/directory/MySQLDatastore/ 信息:MySQLIP = 127.255.0.0 信息:MySQLPort = 20000 information:working; 如何连接这个mysql服务器? – user217648

相关问题