首页 \ 问答 \ 命令和API之间有什么区别来创建一个新的核心?(What are the differences between the command and the API to create a new core?)

命令和API之间有什么区别来创建一个新的核心?(What are the differences between the command and the API to create a new core?)

通过运行以下命令我可以创建一个新的内核。

$ ./bin/solr create -c newcore

Setup new core instance directory:
/Users/myname/Documents/solr/solr-5.2.1/server/solr/newcore

Creating new core 'newcore' using command:
http://localhost:8983/solr/admin/cores?action=CREATE&name=newcore&instanceDir=newcore

{
  "responseHeader":{
    "status":0,
    "QTime":916},
  "core":"newcore"}

但是,我无法通过消息所述的API创建新的内核。

$ curl -X GET 'http://localhost:8983/solr/admin/cores?action=CREATE&name=newcore2&instanceDir=newcore2'
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">400</int><int name="QTime">361</int></lst><lst name="error"><str name="msg">Error CREATEing SolrCore 'newcore2': Unable to create core [newcore2] Caused by: Can't find resource 'solrconfig.xml' in classpath or '/Users/myname/Documents/solr/solr-5.2.1/server/solr/newcore2/conf'</str><int name="code">400</int></lst>
</response>

这两种创建核心的方式有什么不同? 我明白为什么会发生这种情况的错误。 命令的过程与API的过程不一样吗? 我正在使用solr-5.2.1。


I could create a new core by running the following command.

$ ./bin/solr create -c newcore

Setup new core instance directory:
/Users/myname/Documents/solr/solr-5.2.1/server/solr/newcore

Creating new core 'newcore' using command:
http://localhost:8983/solr/admin/cores?action=CREATE&name=newcore&instanceDir=newcore

{
  "responseHeader":{
    "status":0,
    "QTime":916},
  "core":"newcore"}

However, I couldn't create a new core through the API that the message said.

$ curl -X GET 'http://localhost:8983/solr/admin/cores?action=CREATE&name=newcore2&instanceDir=newcore2'
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">400</int><int name="QTime">361</int></lst><lst name="error"><str name="msg">Error CREATEing SolrCore 'newcore2': Unable to create core [newcore2] Caused by: Can't find resource 'solrconfig.xml' in classpath or '/Users/myname/Documents/solr/solr-5.2.1/server/solr/newcore2/conf'</str><int name="code">400</int></lst>
</response>

What are the differences between these two ways to create a core? I understand why the error occurs this case. Is the process of the command not the same as the process of the API? I'm using solr-5.2.1.


原文:https://stackoverflow.com/questions/42434679
更新时间:2024-02-22 11:02

最满意答案

首先,由于您已经完成了本地主分支的所有工作,因此请创建一个指向提示或本地主分支的新功能分支。

$ git checkout -b newfeature master

然后将它保留在服务器中(远程)

$ git checkout master
$ git reset --hard origin/master

I am not sure what happened, but when I followed the git commands by KurzedMetal it didnt give me the desired result.

So I saw no other option than re-doing my changes, despite having taken a backup prior to doing a hard reset back to remote master as well as my export of changed files. Both the export and the backup were worthless as they contained the exact same content as my local repository afterwards, thus my changes were lost. I had expected both to be unchanged.

Luckily, I had stashed my changes before I began on my push problem.
Note: Newly created files were not removed after the hard reset.

Here are my steps to fix:

  1. Finished you changes (still in master)
  2. Pull new changes from remote master and fix any conflicts
  3. TortoiseGit -> Stash save. Enter a message to distinct it from other stashes -> Ok
  4. TortoiseGit -> Show log. Select newest master, then right-click and select Reset, then the Hard option -> Ok
  5. TortoiseGit -> Create Branch. Enter a name and check the box Switch to new branch -> Ok
  6. TortoiseGit -> Stash list. Select your saved stash -> Ok
  7. Now you see a list of different files. For each file, compare the differences and apply the changes again to newly reset files
  8. When done, right-click inside your local folder. You should see Git Commit -> "BranchName" ... above TortoiseGit, choose the first
  9. Confirm which files to commit and then enter a fitting description -> Ok
  10. Now you are ready to push. TortoiseGit -> Push, check that the local branch is your chosen name. If its not, then you forgot to switch branch in 5. and have to continue from 6.

I hope this will help others. The thing to remember: Switch to a new branch when you begin a new feature / non-minor change

相关问答

更多
  • 正如Devin Ceartas提到的那样,当切换分支会改变你已经在本地更改过的某个文件时会发生这种情况。 (当你对一个不会改变的文件进行本地修改,或者添加既不存在于分支也不是master的新文件时,Git不会投诉。) 解决方法有两种: “git藏起来”你的改变,改变主人,和“git藏匿适用”。 然后提交更改。 在分支上提交所需的更改,然后“git藏匿”任何其他更改(如果有),更改为master,并在master上挑选更改。 As Devin Ceartas mentioned, this happens w ...
  • 你需要一个干净的状态来改变分支。 分支检查只有在不影响“脏文件”的情况下才能被允许(正如Charles Bailey在评论中所说的那样)。 否则,您应该: 藏起你目前的变化 reset --hard HEAD (如果你不介意丢失这些微小的变化)或 checkout -f (切换分支时,即使索引或工作树与HEAD不同,也可以继续进行,这用于丢弃本地更改。) You need a clean state to change branches. The branch checkout will only be a ...
  • 尝试这个而不是git checkout : git symbolic-ref HEAD refs/heads/develop 那么你应该可以删除主。 Try this instead of git checkout: git symbolic-ref HEAD refs/heads/develop Then you should be able to delete master.
  • 是的,你可以这样做。 git symbolic-ref HEAD refs/heads/otherbranch 如果您需要在此分支上提交,您将需要重置索引,否则您将最终根据上次签出的分支提交某些内容。 git reset Yes, you can do this. git symbolic-ref HEAD refs/heads/otherbranch If you need to commit on this branch, you'll want to reset the index too ot ...
  • 最近的git版本有足够的DWIM(“做我的意思!”)逻辑来理解你只是在做: git checkout branch1 在那个场合。 如果没有名为branch1本地分支,并且只有一个以branch1结尾的远程跟踪分支,那么这将起作用 - 在这种情况下,它等于较长的分支: git checkout --track -b branch1 origin/branch1 ...应该在任何情况下都有效。 我意识到我错过了回答你以后的一些问题。 git将来自origin资源库的分支状态存储在所谓的“远程跟踪分支”中 ...
  • 首先,由于您已经完成了本地主分支的所有工作,因此请创建一个指向提示或本地主分支的新功能分支。 $ git checkout -b newfeature master 然后将它保留在服务器中(远程) $ git checkout master $ git reset --hard origin/master I am not sure what happened, but when I followed the git commands by KurzedMetal it didnt give me th ...
  • 我可以通过git-stash获取文件: https : //git-scm.com/docs/git-stash 看起来这是一个正常的行为,正如所解释的,这是可能的重复: Git删除忽略的文件,当我切换分支 请不要说我有时使用Github App for Mac OS来提交/切换分支。 不知道它是否起作用。 I could get the file back via git-stash : https://git-scm.com/docs/git-stash It seems that it is a no ...
  • 如果你想交换分支的名称,可能最简单的方法是: git checkout --detach master # we put HEAD on master git branch -f master project # move master to project (HEAD doesn't move) git branch -f project # set project to HEAD git checkout project If you want to exchange the name of the ...
  • 您不克隆您克隆完整存储库的分支,并将本地分支与远程分支连接。 最好的方法是建立一个本地分支。 git branch master -t origin/master 使用该行,您可以将本地分支主服务器与远程分支主服务器连接起来(如果当时不存在)。 然后你可以结账并切换那个分支。 通常,主分支可用,您可以通过结帐将结账切换到另一个分支。 git checkout newbranch You don't clone a branch you clone the complete repository and ...
  • 我将此作为单独的答案添加,因为我认为它确实是最干净和最简单的解决方案,而且没有使用多个本地maven存储库的“技巧”。 简而言之 - 您需要在每个分支中使用不同的工件版本控制。 一个简单的约定可能是: BRANCH-XYZ[-SNAPSHOT] 。 例如: develop分支: 0.0.1-SNAPSHOT abc branch: ABC-0.0.1-SNAPSHOT xyz branch: XYZ-0.0.1-S ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。