简体   繁体   English

我可以让 Memcached 在 Windows (x64) 64 位环境中运行吗?

[英]Can I get Memcached running on a Windows (x64) 64bit environment?

Does anyone know IF , WHEN or HOW I can get Memcached running 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 very good reasons.我知道这可能波及关于32位VS服务器上的64位进行辩论,但我们只想说,我的选择是64位,并且我有一些非常 好的理由。

So far, I've tried a number of options and found a bit of help related to getting this up on a 32bit machine (and succeeded I might add), but since the original Windows port is Win32 specific, this is hardly going to help when installing as a service on x64.到目前为止,我已经尝试了许多选项,并找到了一些与在 32 位机器上安装相关的帮助(并且我可能会成功添加),但是由于原始的Windows 端口是特定于 Win32 的,因此这几乎没有帮助在 x64 上作为服务安装时。 It also has a dependency on the libevent for which I can only get a Win32 compiled version.它还依赖于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?我怀疑简单地在 C++ 中加载所有这些并点击“编译”(对于 64 位)是行不通的,尤其是因为 32 位和 64 位体系结构的复杂差异,但我想知道是否有人正在努力解决这个问题地面? 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 memcached running on a 64 bit Windows server....am I?不幸的是,我的专长仅在于托管代码 (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.是的,恐怕我仍在寻找这个问题的答案——我所有的努力(用我可怜的 C++ 技能)进行稳定的构建都失败了——我已经毁掉了一台服务器,而 3 个虚拟机只是在尝试,所以现在我求助于真正的专家。 Is anyone planning on porting this to 64bit?有人打算将其移植到 64 位吗? Or are you really suggesting that I use MS Velocity instead?还是您真的建议我改用 MS Velocity? I shudder at the thought.想到这里我不寒而栗。


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. @DannySmurf - 我只能将它作为服务安装在 32 位操作系统上。 64 bit OS rejects the installation of this Win32 service. 64 位操作系统拒绝安装此 Win32 服务。 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.当然是的,很多 Win32 代码可以在 x64 架构上无缝运行,因此您可以在 Vista/XP 64 等系统上运行 32 位应用程序(例如 Office)或游戏,但这并不能直接转换为服务。 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.我不是专家,我怀疑这与服务需要订阅的同步或事件有关,我怀疑 64 和 32 不能很好地发挥作用。 I'm happy to be corrected on any of this, but to answer your question - yes I have tried.我很高兴得到纠正,但要回答您的问题 - 是的,我已经尝试过。

@OJ - thanks very much for the straight-forward response. @OJ - 非常感谢您的直接回复。 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.也许当 StackOverflow 上线时,更多的人会回应并让我知道这是否正在调查中,尽管我可以尝试自己编译它 - 我只是不能“相信”(以我的 C++ 经验水平)它将在大型可扩展解决方案的关键组件中提供“企业级”可靠性。 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.哦,好吧……直到下一次。

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.html and 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.更新 2:NorthScale Memcached 不再作为独立下载提供。 Now they have made it part of their commercial No-SQL DB offering called Membase.现在,他们已将其作为名为 Membase 的商业 No-SQL DB 产品的一部分。 It can be configured to run in Memcached-only mode (ie without persistence) and there's a 100% free version too.它可以配置为在 Memcached-only 模式下运行(即没有持久性),并且还有一个 100% 免费版本。 Check it out here: http://www.membase.org/downloads在这里查看: http : //www.membase.org/downloads

UPDATE 3: MemBase has slept with CouchDB and produced a hybrid product offering, called CouchBase.更新 3:MemBase 与 CouchDB 合作,并生产了一种名为 CouchBase 的混合产品。 They still do offer a free "Community" version at http://www.couchbase.com/download他们仍然在http://www.couchbase.com/download提供免费的“社区”版本

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.aspx http://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

Memcached 1.4.5 binary for win x64 can be found here: http://downloads.northscale.com/memcached-1.4.5-amd64.zip可以在此处找到适用于 win x64 的 Memcached 1.4.5 二进制文件: http : //downloads.northscale.com/memcached-1.4.5-amd64.zip

Another option would be to install Couchbase Server 1.8.0 x64 from here: http://www.couchbase.com/download , the bundled memcached seems to be version 1.7.1.1 (sounds like an internal version, I can't tell which is the real one)另一种选择是从这里安装 Couchbase Server 1.8.0 x64: http : //www.couchbase.com/download ,捆绑的 memcached 似乎是 1.7.1.1 版(听起来像是内部版本,我不知道是哪个是真的)

As for running memcached as a service, this tutorial might be enough:至于将 memcached 作为服务运行,本教程可能就足够了:

http://www.richardnichols.net/2010/08/install-memcached-on-windows-server/ http://www.richardnichols.net/2010/08/install-memcached-on-windows-server/

Up-to-date Binaries最新的二进制文件

NorthScale has really old versions (the newest is 1.4.5 which is from April 2010) but there's a guy who offers 64-bit Memcached binaries for Windows compiled using Cygwin (but they don't require it installed) in his GitHub repository github.com/nono303/memcached . NorthScale 有非常旧的版本(最新的是 2010 年 4 月的 1.4.5),但有一个人在他的 GitHub 存储库 github中提供使用 Cygwin 编译的 Windows 64 位 Memcached 二进制文件(但他们不需要安装它) 。 com/nono303/memcached

For example, the binaries of the most recently released version (as of writing this answer) 1.5.16 are here .例如,最近发布的版本(截至撰写此答案时) 1.5.16的二进制文件在这里 There're both 32 and 64-bit versions.有 32 位和 64 位版本。

Memcached as a Windows Service Memcached 作为 Windows 服务

If you want to install it as a Windows service, you can use for example the open-source Non-Sucking Service Manager :如果要将其安装为 Windows 服务,则可以使用例如开源的Non-Sucking Service Manager

nssm install memcached c:\path\to\memcached.exe
nssm start memcached

See the documentation for details.有关详细信息,请参阅文档

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.这就是我设法在 64 位 Windows Server 2008 R2 上为 Win32 运行 memcached 的方法。 memcached.exe -> properties -> Compatibility -> Run this program in compatibility mode for: Windows XP (SP 3) . memcached.exe ->属性->兼容性->以兼容模式运行此程序:Windows XP (SP 3) Notice that the user Uriel Katz mention in this discussion that this method restricted to 2GB memory of use.请注意,用户 Uriel Katz 在此讨论中提到此方法仅限于 2GB 内存的使用。

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.我个人认为您必须使用 64 位编译器(显然在 64 位机器上)重新编译应用程序才能在 64 位平台上充分利用 Memcached。 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.如果它是在考虑 64 位可移植性的情况下编写的,那么它可能是一个简单的重新编译。 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!如果没有,那么在构建它之前你很可能需要进行相当多的修补......然后你必须验证你没有破坏任何东西!

I don't think you're overestimating the differences between 32 and 64-bit at all.我认为您根本没有高估 32 位和 64 位之间的差异。 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 位代码交互时。

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? @John Sably & @DannySmurf:考虑到 Memcached 的性质及其目标,您肯定不想在 64 位机器上运行 32 位版本吗? 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.如果您有一台支持 64 位的机器,那么运行 64 位版本以充分利用硬件的功能是有意义的。

I was just searching for memcached on a 64bit Windows system and found this.我只是在 64 位 Windows 系统上搜索 memcached 并找到了这个。 So far there isn't any Win64 memcached version.到目前为止,还没有任何 Win64 memcached 版本。 But I just started the memcached.exe with the appropriate commands via cmd and it's just running fine.但我刚刚通过 cmd 使用适当的命令启动了 memcached.exe,它运行良好。 I'm using Windows Vista 64bit, don't know if there are any differences between Vista and the server versions.我使用的是 Windows Vista 64 位,不知道 Vista 和服务器版本之间是否有任何差异。

Kindest regards Fleshgrinder最亲切的问候 Fleshgrinder

32 位版本通过 WOW64 在 64 位上运行,但该进程仍然限制为 2GB,使用 64 位版本您可以超越单个机器将拥有的容量。

Dude, Codeplex is your friend -> check out this port of it.伙计, Codeplex是你的朋友 ->查看它的这个端口 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.它曾经有一个 64 位版本,但您可以下载最新版本并编译为 64 位(非常简单)或检查以前的版本。

If this can help, I've done a wrapper based on a compilation of memcached 1.4.5 64-bits found through this page ( direct link to NorthScale binary ).如果这可以提供帮助,我已经根据通过此页面找到的 memcached 1.4.5 64 位编译完成了一个包装器(直接链接到 NorthScale 二进制文件)。

It's a windows service and it works perfectly well in a production environment:这是一个 Windows 服务,它在生产环境中运行良好:
https://github.com/eric-b/MemcachedService64 https://github.com/eric-b/MemcachedService64

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 :)也不要忘记在安装后启动服务:)

您始终可以在一台机器上运行多个 32 位 memcached 进程实例,从而使该机器能够提供总计 > 2GB 的 memcache 空间。

Are you sure that the 32-bit version doesn't just run on 64-bit Windows, without modification?您确定 32 位版本不只是在 64 位 Windows 上运行而无需修改吗? Most things do.大多数事情都可以。

Failing that, have you actually tried just compiling it for 64-bit?如果失败了,您是否真的尝试过将其编译为 64 位? 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.对一些 Google Groups 等进行简短扫描,其中人们提出了同样的问题,这表明这可能正是解决此问题的方法。 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).我认为您可能高估了 32 位和 64 位 Windows 之间的差异(至少就编译本机应用程序而言)。

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

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