【问题标题】:Create memcached service in windows failed在 windows 中创建 memcached 服务失败
【发布时间】:2012-11-13 09:18:34
【问题描述】:

我正在使用Memcached-for-Windows,请参阅:

http://blog.elijaa.org/index.php?post/2010/08/25/Memcached-1.4.5-for-Windows&similar

我试过用:

sc create "memcached" binPath="C:/memcached/mem
cached.exe" start=auto

但我无法创建 Windows 服务,也没有警告或错误,只是:

Creates a service entry in the registry and Service Database.
SYNTAX:
sc create [service name] [binPath= ] <option1> <option2>...
CREATE OPTIONS:
NOTE: The option name includes the equal sign.
type= <own|share|interact|kernel|filesys|rec>
   (default = own)
 start= <boot|system|auto|demand|disabled>
   (default = demand)
 error= <normal|severe|critical|ignore>
       (default = normal)
 binPath= <BinaryPathName>
 group= <LoadOrderGroup>
 tag= <yes|no>
 depend= <Dependencies(separated by / (forward slash))>
 obj= <AccountName|ObjectName>
       (default = LocalSystem)
 DisplayName= <display name>
 password= <password>

【问题讨论】:

    标签: windows-services memcached


    【解决方案1】:

    要实现这一点,您甚至可以执行命令行,从而创建服务。 先通过命令行进入.exe文件所在的路径。

    C:\Users\sireesh.yarlagadda>memcached.exe -d install
    

    执行此行后,您将看到为 memcached 创建的新服务

    【讨论】:

    • 是的! memcached.exe -d install 然后memcached.exe -d start
    【解决方案2】:

    您收到错误的原因是 binPath= 之后必须有一个空格。这是 sc 的一个非常烦人的“功能”。在 start= 之后你还需要一个空格。

    sc create "memcached" binPath= "C:/memcached/memcached.exe" start= auto
    

    上面的命令不会给你语法错误。但是,我怀疑 memcached 仍然无法作为服务成功运行。

    【讨论】:

      【解决方案3】:

      memcached 不是本机 Windows 服务,因此您必须使用“服务包装”程序来添加缺少的功能。 Microsoft's free Srvany utility 应该可以解决问题,但也有几种商业替代品。

      (请注意,memcached 的某些 Windows 端口支持“-d”标志来自动安装和操作 memcached 作为本机 Windows 服务,但在 NorthScale 的版本中似乎不可用...)

      【讨论】:

        【解决方案4】:

        【讨论】:

          猜你喜欢
          • 2015-11-25
          • 1970-01-01
          • 2014-09-13
          • 2015-06-13
          • 2020-01-26
          • 1970-01-01
          • 2014-03-13
          • 1970-01-01
          • 2017-08-08
          相关资源
          最近更新 更多