使用jdbcriver 連接mysql,同步數(shù)據(jù),同步已有的,新增的,修改的,可以同步數(shù)據(jù)但是報(bào)錯(cuò)
我用java程序jdbc查詢數(shù)據(jù)的時(shí)候并不報(bào)錯(cuò),
這是建立索引的代碼:
創(chuàng)建索引
curl -XPUT 'http://localhost:9200/profile'
創(chuàng)建數(shù)據(jù)表與索引映射
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"
}
}
}
}'
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 ? * *"
}
}' 經(jīng)過三個(gè)步驟后,可以同步我本地?cái)?shù)據(jù)庫(kù)中的數(shù)據(jù)了,只是報(bào)錯(cuò),想解決一下,各位幫幫忙
Copyright ? 2019- 91gzw.com 版權(quán)所有 湘ICP備2023023988號(hào)-2
違法及侵權(quán)請(qǐng)聯(lián)系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市萬商天勤律師事務(wù)所王興未律師提供法律服務(wù)