>  기사  >  데이터 베이스  >  同步-elasticseach jdbc-river read only

同步-elasticseach jdbc-river read only

WBOY
WBOY원래의
2016-06-06 09:42:501098검색

同步jdbcriver数据elsaticsearchmysql

使用jdbcriver 连接mysql,同步数据,同步已有的,新增的,修改的,可以同步数据但是报错图片说明
我用java程序jdbc查询数据的时候并不报错,
这是建立索引的代码:
创建索引
curl -XPUT 'http://localhost:9200/profile'
创建数据表与索引映射
curl -XPUT 'http://localhost:9200/profile/user/_mapping' -d '
{
"user": {
"properties": {
"id": {
"type": "string",
"store": "yes"
},
"name": {
"type": "string",
"store": "yes"
},
"login_name": {
"type": "string",
"store": "yes"
}
}
}
}'

  • 运行river同步数据

curl -XPUT 'http://localhost:9200/_river/who_jdbc_river/_meta' -d '{
"type": "jdbc",
"jdbc": {
"driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost:3306/profile",
"user": "root",
"password": "root",
"sql": "select id as _id,name,login_name from user",
"index": "profile",
"type": "user",
"bulk_size": 100,
"max_bulk_requests": 30,
"bulk_timeout": "10s",
"flush_interval": "5s",
"schedule": "0 0-59 0-23 ? * *"
}
}' 经过三个步骤后,可以同步我本地数据库中的数据了,只是报错,想解决一下,各位帮帮忙

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.