- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我无法使用 solr (4.0) 索引我的 mysql 数据库。我总是得到 Indexing failed。回滚所有更改。
我已经查看了以前的答案,但我无法弄清楚这是什么问题。我在 Docker(passenger phusion 和 ubuntu 14.04)容器中运行它。有任何想法吗?我已经花了几天时间试图弄清楚这一点。
docker 组成
version: '2'
services:
search:
env_file: .env
build: .
ports:
- "8080:8080"
volumes:
- ~/.m2:/root/.m2
# - ~/.solr:/data/solr/
- ./docker:/home/app/docker
db:
env_file: .env
image: mysql:5.6
ports:
- "3307:3306"
SOLR_HOME
ls -l /data/solr/collection1/conf/
-rw-r--r-- 1 tomcat7 tomcat7 7601 Oct 17 15:35 data-config.xml
-rw-r--r-- 1 tomcat7 tomcat7 0 Oct 17 15:35 dataimport.properties
-rw-r--r-- 1 tomcat7 tomcat7 561 Oct 17 15:35 log4j.properties
-rw-r--r-- 1 tomcat7 tomcat7 707 Oct 17 15:35 log4j.xml
-rw-r--r-- 1 tomcat7 tomcat7 12302 Oct 17 15:35 schema.xml
-rw-r--r-- 1 tomcat7 tomcat7 479 Oct 17 15:35 solrconfig-qf.xml
-rw-r--r-- 1 tomcat7 tomcat7 41383 Oct 17 15:35 solrconfig.xml
-rw-r--r-- 1 tomcat7 tomcat7 148 Oct 17 15:35 solrcore.properties
-rw-r--r-- 1 tomcat7 tomcat7 138 Oct 17 15:35 solrcore.properties.template
Solr 管理员
data-config.xml https://gist.github.com/anonymous/ce99aa9277f0295a2a52768fb7866e6a
<dataConfig>
<dataSource name="db" type="JdbcDataSource" driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/datacite" user="root"
password="" readonly="true"
batchSize="-1" />
<!-- for batchSize=-1 see DIH FAQ -->
<dataSource name="field" type="FieldReaderDataSource" />
<document>
<!-- SOLR-2104 -->
<!-- using delta import as proposed in http://wiki.apache.org/solr/DataImportHandlerDeltaQueryViaFullImport -->
Sorl 核心属性
mds.db.url=jdbc:mysql://localhost:3306/datacite?useUnicode=true&characterEncoding=UTF8
mds.db.user=datacite
mds.db.password=
mds.testprefix=10.5072
Solrconfig.xml
<!-- AutoCommit
Perform a hard commit automatically under certain conditions.
Instead of enabling autoCommit, consider using "commitWithin"
when adding documents.
http://wiki.apache.org/solr/UpdateXmlMessages
maxDocs - Maximum number of documents to add since the last
commit before automatically triggering a new commit.
maxTime - Maximum amount of time in ms that is allowed to pass
since a document was added before automaticly
triggering a new commit.
openSearcher - if false, the commit causes recent index changes
to be flushed to stable storage, but does not cause a new
searcher to be opened to make those changes visible.
-->
<autoCommit>
<maxTime>15000</maxTime>
<openSearcher>false</openSearcher>
</autoCommit>
<!-- softAutoCommit is like autoCommit except it causes a
'soft' commit which only ensures that changes are visible
but does not ensure that data is synced to disk. This is
faster and more near-realtime friendly than a hard commit.
-->
<!--
<autoSoftCommit>
<maxTime>1000</maxTime>
</autoSoftCommit>
-->
<!-- Update Related Event Listeners
Various IndexWriter related events can trigger Listeners to
take actions.
postCommit - fired after every commit or optimize command
postOptimize - fired after every optimize command
-->
<!-- The RunExecutableListener executes an external command from a
hook such as postCommit or postOptimize.
exe - the name of the executable to run
dir - dir to use as the current working directory. (default=".")
wait - the calling thread waits until the executable returns.
(default="true")
args - the arguments to pass to the program. (default is none)
env - environment variables to set. (default is none)
-->
<!-- This example shows how RunExecutableListener could be used
with the script based replication...
http://wiki.apache.org/solr/CollectionDistribution
-->
<!--
<listener event="postCommit" class="solr.RunExecutableListener">
<str name="exe">solr/bin/snapshooter</str>
<str name="dir">.</str>
<bool name="wait">true</bool>
<arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
<arr name="env"> <str>MYVAR=val1</str> </arr>
</listener>
-->
<!-- Enables a transaction log, currently used for real-time get.
"dir" - the target directory for transaction logs, defaults to the
solr data directory. -->
<updateLog>
<str name="dir">/data/solr/collection1/data</str>
</updateLog>
<dataDir>/data/solr/collection1/data</dataDir>
<lib dir="../../../contrib/dataimporthandler/lib/" regex=".*\.jar" />
<lib dir="../../../dist/" regex="solr-dataimporthandler-\d.*\.jar" />
<lib dir="../../../lib/" regex="mysql-connector-java-5.0.8-bin.jar" />
<requestHandler name="/admin/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
<lst name="invariants">
<str name="db.url">jdbc:mysql://localhost:3306/datacite?useUnicode=true&amp;characterEncoding=UTF8</str>
<str name="db.user">root</str>
<str name="db.password"></str>
<str name="testprefix">10.5072</str>
</lst>
</requestHandler>
最佳答案
问题是我没有连接到 mysql 数据库。 mysql 数据库主机错误。感谢@MatsLindh,我弄明白了。
在 docker compose 中,您的服务
的名称是它们的主机 的名称。因此,在我的例子中,mysql 数据库主机的名称是 db
(请参阅上面问题中的 docker compose)。我的错误是我在环境变量中将 mysql 数据库主机的名称设置为 $DB_HOST = localhost。
当我尝试从 solr 容器连接到 mysql 容器时,我意识到了。我不得不做
mysql --host=db --user=root --password= datacite
因为
mysql --host=localhost --user=root --password= datacite
没有工作。
就这样吧。 在 docker compose 中执行此操作时检查数据库主机的名称。
关于mysql - 我无法用 solr 索引我的数据库。我总是得到 `Indexing failed. Rolled back all changes.`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40091152/
编辑:为了澄清,我想问的是:在什么情况下您会更喜欢一种语法而不是另一种语法? 有什么区别: .trigger('change') 和 .change() 两者都按预期工作。在任何情况下语法都会有所不同
这个问题在这里已经有了答案: Difference between .on('click') vs .click() (12 个答案) 关闭 6 年前。 有什么区别: $('选择器').change
我用的是Select2-4.0.0 和 $gameSelect.select2().on("change",function(e){....} 工作正常。 但是当我将它链接起来时('change')就
有一天在#haskell 上,有人提到了当字符串改变时字符串的类型应该如何改变的概念。这让我想起了我项目中的一些代码。它一直困扰着我,我说不清为什么。我现在推测,原因是我没有实现这个概念。这是下面的代
我使用了 .on("change") 事件函数,因为我的整个代码中有一部分是动态变化的。 .trigger("change") 在 .change() 中工作正常,但在 .on("change") 中
下面是一个非常简单的表单下拉列表设置。但是,on-change 事件拒绝触发...除非它更改为 ng-change。 这让我卡住了大约一个小时,因为我们在网站的其他地方使用了相同的设置(即模型属性/列
我有两个v-model 案例一: 这很好用 案例二: 即使改变 u1 也会触发 onDateChange(); 最佳答案 :change 绑定(bind)属性,如 v-bind:change=
我找到了 .and方法对于链接许多期望非常有用。 expect { click_button 'Update Boilerplate' @boilerplate_original.reload
出于合规性原因,我需要捕获所有数据库更改。我知道 Change Feed 存储此信息(并且我正在等待完全保真度来捕获删除)。目前,我一直在通过 Function 触发器读取 Change Feed 并
我添加了一个data-ng-change='getSubjectsClasswise(classBean.class_id);'上课标签,但主题未在主题 处加载标签。 一切看起来都很好,没有遇到问题
我有一组复选框,当您单击其中一个时,它们应该全部被选中。 当用户单击一个复选框时,它会检查以该类名称开头的所有其他复选框。我想要的是用户单击一个复选框,并且每次单击仅触发一次 $(".atpSelec
我在 Stack Overflow 上阅读了很多有关此问题的内容,并应用了所有建议的解决方案(getShell pack、布局、getparent 布局等...),但没有一个起作用。 我有一个带有文本
我想更改我的索引。我的数据框如下: partA = pd.DataFrame({'u1': 2, 'u2': 3, 'u3':4, 'u4':29, 'u5':4, 'u6':1, 'u7':323,
我有一个像这样的下拉菜单: Grade Year 旁边还有另一个下拉菜单: 3 4
这个问题已经有人问过,但我只停留在最基本的层面上。除了选择标记和尝试通过 jquery 捕获更改事件外,我没有向我的 html 添加任何内容。这是我的代码: $('#target').bin
我只是 Django 的新手几天。现在,当自定义表单中其他字段的值发生变化时,我需要同时更改一个字段中的值和表示形式。此时更改 MyModel 是受限。 我的应用程序/models.py: class
我正在使用 ListView 控件来显示一些数据行。有一个后台任务接收列表内容的外部更新。新收到的数据可能包含更少、更多或相同数量的项目,而且项目本身可能已更改。 ListView.ItemsSour
我在 android studio 中使用 git 插件。我的问题是当我提交更改列表(公开提交)时,但我在更改列表中的评论是错误的/丢失的,我想更改它。 问题: 有没有办法通过 AndroidStud
MyCustomObject * object=new MyCustomObject(); 假设我的许多类都使用了对象指针,但突然间我想在不更改地址的情况下更改指针的内容。 我认为 object =
我正在使用新的 KeyValue Observing。当变量发生变化时,我接到了我的观察者的电话,但 change struct 附带 newValue和 oldValue都为 nil ,所以它永远不
我是一名优秀的程序员,十分优秀!