C# 我可以让 Memcached 在 Windows (x64) 64 位环境中运行吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8896/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can I get Memcached running on a Windows (x64) 64bit environment?
提问by RobertTheGrey
Does anyone know IF, WHENor HOWI can get Memcachedrunning on a Windows 64bit environment?
有谁知道如果、何时或如何让Memcached在 Windows 64 位环境中运行?
I'm setting up a new hosting solution and would much prefer to run a 64bit OS, and since it's an ASP.Net MVC solution with SQL Server DB, the OS is either going to be Windows Server 2003 or (hopefully!) 2008.
我正在设置一个新的托管解决方案,并且更喜欢运行 64 位操作系统,并且由于它是带有 SQL Server DB 的 ASP.Net MVC 解决方案,因此操作系统要么是 Windows Server 2003,要么是(希望如此!)2008。
I know that this could spill over into a debate regarding 32bit vs 64bit on servers, but let's just say that my preference is 64bit and that I have some verygoodreasons.
我知道这可能波及关于32位VS服务器上的64位进行辩论,但我们只想说,我的选择是64位,并且我有一些非常好的理由。
So far, I've tried a number of options and found a bitof helprelated to getting this up on a 32bit machine (and succeeded I might add), but since the original Windows portis Win32 specific, this is hardly going to help when installing as a service on x64. It also has a dependency on the libeventfor which I can only get a Win32 compiled version.
到目前为止,我已经尝试了许多选项,并找到了一些与在 32 位机器上安装相关的帮助(并且我可能会成功添加),但是由于原始的Windows 端口是特定于 Win32 的,因此这几乎没有帮助在 x64 上作为服务安装时。它还依赖于libevent,我只能获得 Win32 编译版本。
I suspect that simply loading all this up in C++ and hitting "compile" (for 64bit) wouldn't work, not least because of the intricate differences in 32 and 64bit architectures, but I'm wondering if anyone is working on getting this off the ground? Unfortunately, my expertise lie in managed code (C#) only, otherwise I would try and take this on myself, but I can't believe I'm the only guy out there trying to get memcachedrunning on a 64 bit Windows server....am I?
我怀疑简单地在 C++ 中加载所有这些并点击“编译”(对于 64 位)是行不通的,尤其是因为 32 位和 64 位架构的复杂差异,但我想知道是否有人正在努力解决这个问题地面?不幸的是,我的专长仅在于托管代码 (C#),否则我会尝试自己承担这个问题,但我不敢相信我是唯一一个试图让memcached在 64 位 Windows 服务器上运行的人。 ..是我吗?
Update
更新
Yes I'm afraid I'm still looking for an answer to this - all my efforts (with my pathetic C++ skills) to make a stable build have failed - I've trashed one server and 3 VM's just trying it out so now I turn to the real experts. Is anyone planning on porting this to 64bit? Or are you really suggesting that I use MS Velocity instead? I shudder at the thought.
是的,恐怕我仍在寻找这个问题的答案——我所有的努力(用我可怜的 C++ 技能)进行稳定的构建都失败了——我已经毁掉了一台服务器,而 3 个虚拟机只是在尝试,所以现在我求助于真正的专家。有人打算将其移植到 64 位吗?还是您真的建议我改用 MS Velocity?想到这里我不寒而栗。
Update: @Lars - I do use Enyim actually - it's very good, but what you're referring to is a client, rather than the server part.
更新:@Lars - 实际上我确实使用 Enyim - 它非常好,但您指的是客户端,而不是服务器部分。
@DannySmurf - I've only been able to install it as a service on a 32 bit OS. 64 bit OS rejects the installation of this Win32 service. Of course yes, lots of Win32 code works seamlessly on x64 architecture, hence you can run 32bit apps (like Office for instance) or games on Vista/XP 64 etc, but this doesn't translate directly when it comes to services. I'm no expert, I suspect that it has to do with the syncs or eventing that services need to subscribe to, and I suspect that 64 and 32 don't play nicely. I'm happy to be corrected on any of this, but to answer your question - yes I have tried.
@DannySmurf - 我只能将它作为服务安装在 32 位操作系统上。64 位操作系统拒绝安装此 Win32 服务。当然是的,许多 Win32 代码可以在 x64 架构上无缝运行,因此您可以在 Vista/XP 64 等上运行 32 位应用程序(例如 Office)或游戏,但这并不能直接转换为服务。我不是专家,我怀疑这与服务需要订阅的同步或事件有关,我怀疑 64 和 32 不能很好地发挥作用。我很高兴得到纠正,但要回答您的问题 - 是的,我已经尝试过。
@OJ - thanks very much for the straight-forward response. I thought as much, but wasn't sure if anyone else had suggestions or had already gone down this route. Maybe when StackOverflow is LIVE, then more people will respond and let me know if this is something being looked into, and although I can try and compile it myself - I simply can't "trust" (with my C++ experience level) that it would provide "Enterprise Level" reliability in such a crucial component of large scalable solutions. I think it would need educated intervention rather than my unsanitised experimental approach before I could be confident. One little oversight on my part, could bring the site down. Oh well... till next time.
@OJ - 非常感谢您的直接回复。我想了很多,但不确定是否有人有建议或已经沿着这条路走下去了。也许当 StackOverflow 上线时,更多的人会回应并让我知道这是否正在调查中,尽管我可以尝试自己编译它 - 我只是不能“相信”(以我的 C++ 经验水平)它将在大型可扩展解决方案的关键组件中提供“企业级”可靠性。我认为在我有信心之前,它需要受过教育的干预而不是我未经消毒的实验方法。我的一个小疏忽可能会使网站瘫痪。哦,好吧……直到下一次。
采纳答案by zvolkov
North Scale labs have released a build of memcached 1.4.4 for Windows x64:
North Scale 实验室已经发布了适用于 Windows x64 的 memcached 1.4.4 版本:
http://blog.couchbase.com/memcached-windows-64-bit-pre-release-available
http://blog.couchbase.com/memcached-windows-64-bit-pre-release-available
http://labs.northscale.com/memcached-packages/
http://labs.northscale.com/memcached-packages/
UPDATE: they have recently released Memcached Server - still FREE but enhanced distro with clustering, web-based admin/stats UI etc. (I'm not related to them in any way) Check it out at http://northscale.com/products/memcached.htmland download at: http://www.northscale.com/download.php?a=d
更新:他们最近发布了 Memcached 服务器 - 仍然免费但增强的发行版具有集群、基于 Web 的管理/统计 UI 等(我与他们没有任何关系)在http://northscale.com/ 上查看products/memcached.html并下载:http: //www.northscale.com/download.php?a=d
UPDATE 2: NorthScale Memcached is no longer available as a standalone download. Now they have made it part of their commercial No-SQL DB offering called Membase. It can be configured to run in Memcached-only mode (i.e. without persistence) and there's a 100% free version too. Check it out here: http://www.membase.org/downloads
更新 2:NorthScale Memcached 不再作为独立下载提供。现在,他们已将其作为名为 Membase 的商业 No-SQL DB 产品的一部分。它可以配置为在 Memcached-only 模式下运行(即没有持久性),并且还有一个 100% 免费版本。在这里查看:http: //www.membase.org/downloads
UPDATE 3: MemBase has slept with CouchDB and produced a hybrid product offering, called CouchBase. They still do offer a free "Community" version at http://www.couchbase.com/download
更新 3:MemBase 与 CouchDB 合作,并生产了一种名为 CouchBase 的混合产品。他们仍然在http://www.couchbase.com/download提供免费的“社区”版本
回答by TheSmurf
Are you sure that the 32-bit version doesn't just run on 64-bit Windows, without modification? Most things do.
您确定 32 位版本不只是在 64 位 Windows 上运行而无需修改吗?大多数事情都可以。
Failing that, have you actually tried just compiling it for 64-bit? A brief scan of a few Google Groups etc where people asked this same question suggests that that may be exactly the solution to this. I think you're probably overestimating the difference between 32-bit and 64-bit Windows (at least as far as compiling a native application goes).
如果失败,您是否真的尝试过将其编译为 64 位?对一些 Google Groups 等进行简短扫描,其中人们提出了同样的问题,这表明这可能正是解决此问题的方法。我认为您可能高估了 32 位和 64 位 Windows 之间的差异(至少就编译本机应用程序而言)。
回答by OJ.
I personally feel that you'd have to recompile the application using a 64-bit compiler (obviously on a 64-bit machine) to get the most of Memcached on a 64-bit platform. This may not be an easy task depending on the code. If it was written with 64-bit portability in mind then it could be a simple recompile. If it hasn't, then you could well be up for quite a bit of patching before getting it to build.. and then you'd have to verify that you haven't broken anything!
我个人认为您必须使用 64 位编译器(显然在 64 位机器上)重新编译应用程序才能在 64 位平台上充分利用 Memcached。根据代码,这可能不是一件容易的事。如果它是在考虑 64 位可移植性的情况下编写的,那么它可能是一个简单的重新编译。如果没有,那么在构建它之前你很可能需要进行相当多的修补......然后你必须验证你没有破坏任何东西!
I don't think you're overestimating the differences between 32 and 64-bit at all. A common mistake is to assume that the job is a simple recompile when in fact it isn't. There are more portability issues than most people realise. Just because the application builds and you end up with a binary, it doesn't mean that the binary is going to behave as it should. Especially when it may interact with other 32-bit code.
我认为您根本没有高估 32 位和 64 位之间的差异。一个常见的错误是假设该作业是简单的重新编译,而实际上并非如此。便携性问题比大多数人意识到的要多。仅仅因为应用程序构建并且你最终得到一个二进制文件,并不意味着二进制文件会像它应该的那样运行。特别是当它可能与其他 32 位代码交互时。
Having said that, it might be worth giving it a spin!
话虽如此,可能值得一试!
Good luck. Cheers!
祝你好运。干杯!
@Lars: I recommend reading the question before attempting an answer.
@Lars:我建议在尝试回答之前阅读问题。
@John Sibly & @DannySmurf: given the nature of Memcached and what it aims to achieve, surely you wouldn't want to run a 32-bit version on a 64-bit machine? If you had a 64-bit capable machine it would make sense to run a 64-bit version to make the most of the features of the hardware.
@John Sably & @DannySmurf:考虑到 Memcached 的性质及其目标,您肯定不想在 64 位机器上运行 32 位版本吗?如果您有一台支持 64 位的机器,那么运行 64 位版本以充分利用硬件的功能是有意义的。
回答by Pure.Krome
Dude, Codeplexis your friend -> check out this portof it. It used to have a 64bit release, but u can either download the latest and compile for 64bit (pretty easy) or check the previous releases.
伙计,Codeplex是你的朋友 ->看看它的这个端口。它曾经有一个 64 位版本,但您可以下载最新版本并编译为 64 位(非常简单)或检查以前的版本。
回答by Pure.Krome
I was just searching for memcached on a 64bit Windows system and found this. So far there isn't any Win64 memcached version. But I just started the memcached.exe with the appropriate commands via cmd and it's just running fine. I'm using Windows Vista 64bit, don't know if there are any differences between Vista and the server versions.
我只是在 64 位 Windows 系统上搜索 memcached 并找到了这个。到目前为止,还没有任何 Win64 memcached 版本。但我刚刚通过 cmd 使用适当的命令启动了 memcached.exe,它运行良好。我使用的是 Windows Vista 64 位,不知道 Vista 和服务器版本之间是否有任何差异。
Kindest regards Fleshgrinder
最亲切的问候 Fleshgrinder
回答by Uriel Katz
The 32 bit version run on 64 bit via WOW64 but the process is still limited to 2GB,with a 64-bit version you can go beyond that to more than a single machine will have.
32 位版本通过 WOW64 在 64 位上运行,但该进程仍然限制为 2GB,使用 64 位版本您可以超越单个机器将拥有的容量。
回答by Jasper Rosenberg
FYI, I couldn't get the 64 bit version (from here http://labs.northscale.com/memcached-packages/) to install as a service until I ran memcached as administrator.
仅供参考,在我以管理员身份运行 memcached 之前,我无法将 64 位版本(从这里http://labs.northscale.com/memcached-packages/)安装为服务。
I just went to the executable's properties, then the Compatibility tab, and checked "Run this program as an administrator" (There a ton of other ways to do this, but it seemed simplest)
我只是转到可执行文件的属性,然后是兼容性选项卡,然后选中“以管理员身份运行此程序”(有很多其他方法可以执行此操作,但似乎最简单)
Then I was finally able to successfully run: memcached -d install
然后我终于可以成功运行了:memcached -d install
Don't forget to start the service after it is installed too :)
也不要忘记在安装后启动服务:)
回答by jim77
I have an memcached-1.2.1 for win32 originally downloaded from here: http://jehiah.cz/projects/memcached-win32/(but now for some reason it is a broken link).
我有一个用于 win32 的 memcached-1.2.1 最初是从这里下载的:http: //jehiah.cz/projects/memcached-win32/(但现在由于某种原因它是一个断开的链接)。
This is how I managed to run memcached for Win32 on Windows Server 2008 R2, 64 bit. memcached.exe-> properties-> Compatibility-> Run this program in compatibility mode for: Windows XP (SP 3). Notice that the user Uriel Katz mention in this discussion that this method restricted to 2GB memory of use.
这就是我设法在 64 位 Windows Server 2008 R2 上为 Win32 运行 memcached 的方法。 memcached.exe->属性->兼容性->以兼容模式运行此程序:Windows XP (SP 3)。请注意,用户 Uriel Katz 在此讨论中提到此方法仅限于 2GB 内存的使用。
回答by Ken
You could always run multiple instances of 32-bit memcached processes on one box, allowing that machine to serve a total of > 2GB memcache space.
您始终可以在一台机器上运行多个 32 位 memcached 进程实例,从而使该机器能够提供总计 > 2GB 的 memcache 空间。
回答by Lennie
Just so people know, the 32-bit and 64-bit version as build by the good people from membase/couchbase/whatever is still available the blog URL has changed though:
只是让人们知道,由来自 membase/couchbase/whatever 的好人构建的 32 位和 64 位版本仍然可用,但博客 URL 已更改:
32-bit binary of memcached 1.4.4 as Windows-service:
memcached 1.4.4 的 32 位二进制文件作为 Windows 服务:
http://blog.couchbase.com/memcached-144-windows-32-bit-binary-now-available
http://blog.couchbase.com/memcached-144-windows-32-bit-binary-now-available
http://s3.amazonaws.com/downloads.northscale.com/memcached-win32-1.4.4-14.zip
http://s3.amazonaws.com/downloads.northscale.com/memcached-win32-1.4.4-14.zip
64-bit binary of memcached 1.4.4 as Windows-service:
memcached 1.4.4 的 64 位二进制文件作为 Windows 服务:
http://blog.couchbase.com/memcached-windows-64-bit-pre-release-available
http://blog.couchbase.com/memcached-windows-64-bit-pre-release-available
http://s3.amazonaws.com/downloads.northscale.com/memcached-win64-1.4.4-14.zip
http://s3.amazonaws.com/downloads.northscale.com/memcached-win64-1.4.4-14.zip
The 64-bit version does have the wrong uptime.
64 位版本确实有错误的正常运行时间。
So maybe you want this binary of 1.4.2 instead:
所以也许你想要这个 1.4.2 的二进制文件:
http://www.urielkatz.com/archive/detail/memcached-64-bit-windows/
http://www.urielkatz.com/archive/detail/memcached-64-bit-windows/
The 32-bit version as included with MemCacheDManager also suppors running on Windows 2000 (no IPv6):
MemCacheDManager 中包含的 32 位版本也支持在 Windows 2000(无 IPv6)上运行:
http://allegiance.chi-town.com/MemCacheDManager.aspxhttp://allegiance.chi-town.com/Download.aspx?dl=Releases/MemCacheDManager_1_0_3_0.msi&rurl=MemCacheDManager.aspx
http://allegiance.chi-town.com/MemCacheDManager.aspx http://allegiance.chi-town.com/Download.aspx?dl=Releases/MemCacheDManager_1_0_3_0.msi&rurl=MemCacheDManager.aspx
To unpack the msi:
解压 msi:
msiexec /a Releases_MemCacheDManager_1_0_3_0.msi /qb TARGETDIR=c:\memcached
msiexec /a Releases_MemCacheDManager_1_0_3_0.msi /qb TARGETDIR=c:\memcached