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/11/05 07:08:18 UTC

[GitHub] [shardingsphere-elasticjob] zjcnb opened a new issue #2006: Repeat instances ip when update job

zjcnb opened a new issue #2006:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2006


   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere-elasticjob/issues).
   - Read documentation: [ElasticJob Doc](https://shardingsphere.apache.org/elasticjob/current/en/overview/).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ElasticJob did you use?
   
   3.0.1
   
   ### Which project did you use? ElasticJob-Lite or ElasticJob-Cloud?
   
   ElasticJob-Lite
   
   ### Expected behavior
   
   Only one instances ip
   
   ### Actual behavior
   
   two instances ip
   
   ![image](https://user-images.githubusercontent.com/33742097/140471671-21586a00-2b1c-4681-a0e2-c8ca2b5db4f5.png)
   
   
   update job code:
   
   
   ```
    for (Entry<String, DatabaseDiscoveryDataSourceRule> entry : dataSourceRules.entrySet()) {
                   ZookeeperRegistryCenter registryCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(entry.getValue().getDatabaseDiscoveryType().getProps().getProperty("zkServerLists"), "mgr-elasticjob"));
                   registryCenter.init();
                   new JobConfigurationAPIImpl(registryCenter).updateJobConfiguration(createJobConfiguration("MGR-" + entry.getKey(), entry.getValue().getDatabaseDiscoveryType().getProps().getProperty("keepAliveCron")));
               }
               
   ```
   
   
   ```
    private JobConfigurationPOJO createJobConfiguration(final String jobName, final String cron) {
           JobConfigurationPOJO result = new JobConfigurationPOJO();
           result.setJobName(jobName);
           result.setCron(cron);
           result.setShardingTotalCount(1);
           return result;
       }
   ```
   
   
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org