代码之家  ›  专栏  ›  技术社区  ›  Abdus Sattar Bhuiyan

“cbimport”未被识别为内部或外部命令、可操作程序或批处理文件

  •  1
  • Abdus Sattar Bhuiyan  · 技术社区  · 8 年前

    我开始学习couchbase。一切都很好。我遵循couchbase官方网站的逐步指导方针。在某种程度上,本分步教程建议我使用命令提示符运行。在此,我复制了确切的指导原则:

     1.Open a Command (Terminal) window, and navigate to the Couchbase ​bin
    ​ folder. 
    
    Mac OSX /Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin/ Windows C:\Program Files\Couchbase\Server\bin\ Linux /opt/couchbase/bin/ 
    
    11.Add this folder to your operating system PATH statement, so that its commands may be invoked from any location. If needed, see your operating system documentation for specific details on this process. 12.In the Terminal, navigate to the ​/CB121
    ​ folder on your desktop, which contains the products-data.json 
    ​ file and ​orders-data.json
    ​ file. 
    
    
    
    
    13.Use the ​cbimport 
    ​ tool to load the JSON documents in ​products-data.json
    ​ to the WineSearch
    ​ bucket (bucket names are case sensitive). To ensure uniqueness, assign an incrementing integer (​#MONO_INCR#
    ​ ) value to each record as part of its document key, prefixed by its ​type
    ​ and ​variety
    ​ , using "​::
    ​ " as a separator. 
     ❏ Cluster (-c): couchbase://127.0.0.1 ❏ Username (-u): WineSearcher ❏ Password (-p): password ❏ Bucket (-b): WineSearch ❏ Format (-f): lines ❏ Dataset (-d): file://products-data.json ❏ Threads (-t): 4 ❏ Key Pattern to Generate (-g): %type%::%variety%::#MONO_INCR# 
    
    
     cbimport json -c couchbase://127.0.0.1 -u WineSearcher -p password -b WineSearch -f lines -d file://products-data.json -t 4 -g %type%::%variety%::#MONO_INCR# 
    
    
    
    Note, code statements in this document can be copied and pasted to your tool. 
    

    当我运行此命令时 cbimport json -c couchbase://127.0.0.1 -u WineSearcher -p password -b WineSearch -f lines -d file://products-data.json -t 4 -g %type%::%variety%::#MONO_INCR# 我收到以下错误:

    'cbimport' is not recognized as an internal or external command, operable program or batch file.
    

    在我看来,我可能需要安装任何工具,如cbimport。我在谷歌上搜索了几个小时。没有这样的工具。我觉得自己像个哑巴。非常感谢您的帮助。

    N、 B:我将环境变量设置如下: enter image description here

    1 回复  |  直到 8 年前
        1
  •  4
  •   Gerhard    8 年前

    您的文件不在路径中。这应该会解决问题(或添加 .exe 之后 cbimport )

    "C:\Program Files\Couchbase\Server\bin\cbimport" json -c couchbase://127.0.0.1 -u WineSearcher -p password -b WineSearch -f lines -d file://products-data.json -t 4 -g %type%::%variety%::#MONO_INCR#
    

    注意!! 现在,您必须确保为JSON文件设置了正确的路径。

    但是,您希望它尽可能短,因此添加 C:\Program Files\Couchbase\Server\bin 在path变量中,转到:

    控制面板->系统->环境变量

    查找路径并添加

    ;C:\Program Files\Couchbase\Server\bin 在路径的末尾,然后保存并退出。

    重要的是 现在您需要关闭 cmd.exe windows并重新打开,否则仍将读取旧环境。