You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/03/18 10:48:12 UTC
[GitHub] [shardingsphere] cowcomic opened a new issue #9733: Throw Execption when adding a scaling Job
cowcomic opened a new issue #9733:
URL: https://github.com/apache/shardingsphere/issues/9733
## Bug Report
### Which version of ShardingSphere did you use?
5.0.0-RC1-SNAPSHOT
build from git master
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
shardingsphere-scaling
### Expected behavior
I want to move data from one Sharding to another Sharding
### Actual behavior
I make a curl post like this. edit by demo from https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-scaling/usage/
```curl -X POST \
http://localhost:8888/scaling/job/start \
-H 'content-type: application/json' \
-d '{
"ruleConfiguration": {
"source": {
"type": "shardingSphereJdbc",
"parameter": {
"dataSource":"
dataSources:
ds_0:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
props:
driverClassName: com.mysql.jdbc.Driver
jdbcUrl: jdbc:mysql://192.168.0.142:3306/aaaa?serverTimezone=UTC&useSSL=false
username: root
password: xxx
ds_1:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
props:
driverClassName: com.mysql.jdbc.Driver
jdbcUrl: jdbc:mysql://192.168.0.88:3306/aaaa?serverTimezone=UTC&useSSL=false
username: root
password: xxx
",
"rule":"
rules:
tables:
t_calabash_label:
actualDataNodes: ds_${0..1}.t_calabash_label_${0..7}
inline:
shardingColumn: USERID
algorithmExpression: ds_${USERID.toLong() & 0x01}
tableStrategy:
inline:
shardingColumn: USERID
algorithmExpression: t_calabash_label_${USERID.toLong() % 8}
"
}
},
"target": {
"type": "shardingSphereJdbc",
"parameter": {
"username": "root",
"password": "xxx",
"jdbcUrl": "jdbc:mysql://192.168.0.227:3307/aaaa?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai"
}
}
},
"jobConfiguration":{
"concurrency":"3"
}
}'
```
http response is
`{"success":false,"errorCode":500,"errorMsg":"java.lang.NullPointerException","model":null}`
and server log Exception
```
[INFO ] 2021-03-18 18:42:12.569 [nioEventLoopGroup-2-1] i.n.handler.logging.LoggingHandler - [id: 0xb23471bd, L:/0.0.0.0:8888] READ: [id: 0x63970fc8, L:/127.0.0.1:8888 - R:/127.0.0.1:40004]
[INFO ] 2021-03-18 18:42:12.569 [nioEventLoopGroup-2-1] i.n.handler.logging.LoggingHandler - [id: 0xb23471bd, L:/0.0.0.0:8888] READ COMPLETE
[INFO ] 2021-03-18 18:42:12.570 [nioEventLoopGroup-3-4] o.a.s.scaling.web.HttpServerHandler - Http request path: /scaling/job/start
[INFO ] 2021-03-18 18:42:12.570 [nioEventLoopGroup-3-4] o.a.s.scaling.web.HttpServerHandler - Http request body: {
"ruleConfiguration": {
"source": {
"type": "shardingSphereJdbc",
"parameter": {
"dataSource":"
dataSources:
ds_0:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
props:
driverClassName: com.mysql.jdbc.Driver
jdbcUrl: jdbc:mysql://192.168.0.142:3306/aaaa?serverTimezone=UTC&useSSL=false
username: root
password: xxx
ds_1:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
props:
driverClassName: com.mysql.jdbc.Driver
jdbcUrl: jdbc:mysql://192.168.0.88:3306/aaaa?serverTimezone=UTC&useSSL=false
username: root
password: xxx
",
"rule":"
rules:
tables:
t_calabash_label:
actualDataNodes: ds_${0..1}.t_calabash_label_${0..7}
inline:
shardingColumn: USERID
algorithmExpression: ds_${USERID.toLong() & 0x01}
tableStrategy:
inline:
shardingColumn: USERID
algorithmExpression: t_calabash_label_${USERID.toLong() % 8}
"
}
},
"target": {
"type": "shardingSphereJdbc",
"parameter": {
"username": "root",
"password": "xxx",
"jdbcUrl": "jdbc:mysql://192.168.0.227:3307/aaaa?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai"
}
}
},
"jobConfiguration":{
"concurrency":"3"
}
}
[ERROR] 2021-03-18 18:42:12.571 [nioEventLoopGroup-3-4] o.a.s.scaling.web.HttpServerHandler - Http request handle occur error:
java.lang.NullPointerException: null
at org.apache.shardingsphere.scaling.core.util.JobConfigurationUtil.fillInProperties(JobConfigurationUtil.java:95)
at org.apache.shardingsphere.scaling.core.api.impl.ScalingAPIImpl.start(ScalingAPIImpl.java:84)
at org.apache.shardingsphere.scaling.web.HttpServerHandler.startJob(HttpServerHandler.java:92)
at org.apache.shardingsphere.scaling.web.HttpServerHandler.channelRead0(HttpServerHandler.java:65)
at org.apache.shardingsphere.scaling.web.HttpServerHandler.channelRead0(HttpServerHandler.java:51)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] avalon5666 closed issue #9733: Throw Execption when adding a scaling Job
Posted by GitBox <gi...@apache.org>.
avalon5666 closed issue #9733:
URL: https://github.com/apache/shardingsphere/issues/9733
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] cowcomic commented on issue #9733: Throw Execption when adding a scaling Job
Posted by GitBox <gi...@apache.org>.
cowcomic commented on issue #9733:
URL: https://github.com/apache/shardingsphere/issues/9733#issuecomment-804728608
start a worker as a new server. and work well
need a job clear api
now have to delete from zookeeper
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] cowcomic commented on issue #9733: Throw Execption when adding a scaling Job
Posted by GitBox <gi...@apache.org>.
cowcomic commented on issue #9733:
URL: https://github.com/apache/shardingsphere/issues/9733#issuecomment-802629248
i make a new request like this
```
curl -X POST \
http://localhost:8888/scaling/job/start \
-H 'content-type: application/json' \
-d '{
"ruleConfig": {
"source": {
"type": "shardingSphereJdbc",
"parameter": "
dataSources:
ds_0:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
jdbcUrl: jdbc:mysql://192.168.0.142:3306/aaaa?serverTimezone=UTC&useSSL=false
username: root
password: xxx
ds_1:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
jdbcUrl: jdbc:mysql://192.168.0.88:3306/aaaa?serverTimezone=UTC&useSSL=false
username: root
password: xxx
rules:
- !SHARDING
tables:
t_calabash_label:
actualDataNodes: ds_${0..1}.t_calabash_label_${0..7}
databaseStrategy:
standard:
shardingColumn: USERID
shardingAlgorithmName: t_calabash_db_algorith
tableStrategy:
standard:
shardingColumn: USERID
shardingAlgorithmName: t_calabash_label_algorith
t_calabash_label_user:
actualDataNodes: ds_${0..1}.t_calabash_label_user_${0..7}
databaseStrategy:
standard:
shardingColumn: USERID
shardingAlgorithmName: t_calabash_db_algorith
tableStrategy:
standard:
shardingColumn: USERID
shardingAlgorithmName: t_calabash_label_user_algorith
t_calabash_label_story:
actualDataNodes: ds_${0..1}.t_calabash_label_story_${0..7}
databaseStrategy:
standard:
shardingColumn: USERID
shardingAlgorithmName: t_calabash_db_algorith
tableStrategy:
standard:
shardingColumn: USERID
shardingAlgorithmName: t_calabash_label_story_algorith
shardingAlgorithms:
t_calabash_db_algorith:
type: INLINE
props:
algorithm-expression: ds_${USERID % 2}
t_calabash_label_algorith:
type: INLINE
props:
algorithm-expression: t_calabash_label_${USERID % 8}
t_calabash_label_user_algorith:
type: INLINE
props:
algorithm-expression: t_calabash_label_user_${USERID % 8}
t_calabash_label_story_algorith:
type: INLINE
props:
algorithm-expression: t_calabash_label_story_${USERID % 8}
"
},
"target": {
"type": "jdbc",
"parameter": "
username: root,
password: xxx,
jdbcUrl: jdbc:mysql://192.168.0.227:3307/aaaa?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
"
}
},
"jobConfiguration":{
"concurrency":"3"
}
}'
```
this time no error in back server
![image](https://user-images.githubusercontent.com/4745969/111747901-d4ce6700-88ca-11eb-8e5b-57e1c7465b08.png)
![image](https://user-images.githubusercontent.com/4745969/111747952-e44db000-88ca-11eb-8d10-a9c9a87bddc6.png)
![image](https://user-images.githubusercontent.com/4745969/111748000-f0397200-88ca-11eb-8ba4-1dc9102a79b7.png)
but job state seems not right
![image](https://user-images.githubusercontent.com/4745969/111748355-62aa5200-88cb-11eb-965f-ea4fc98f0397.png)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] avalon5666 commented on issue #9733: Throw Execption when adding a scaling Job
Posted by GitBox <gi...@apache.org>.
avalon5666 commented on issue #9733:
URL: https://github.com/apache/shardingsphere/issues/9733#issuecomment-802051382
[Latest documents](https://github.com/apache/shardingsphere/pull/9738)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org