You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/06/22 02:44:31 UTC

[GitHub] [skywalking] xuanyuan1hao opened a new issue #7152: skywalking stored on elasticsearch and create too many index ,and index doc count is zero

xuanyuan1hao opened a new issue #7152:
URL: https://github.com/apache/skywalking/issues/7152


   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ ] Question or discussion
   - [*] Bug
   - [ ] Requirement
   - [ ] Feature or performance improvement
   
   ___
   ### Question
   - skywalking会创建太多的索引库,我这里进行了代码修改,删除一天以前历史记录中文档数量为0的索引库。
   
   ### Requirement or improvement
   - 修改代码:HistoryDeleteEsDAO .java 
   - long  deadline2 = Long.parseLong(new DateTime().plusDays(-1).toString("yyyyMMdd"));
   -  for (String index : indexes) {
               long timeSeries = TimeSeriesUtils.isolateTimeFromIndexName(index);
               if (deadline >= timeSeries||(client.indexDocIsZero(tableName) && deadline2>= timeSeries)) {
                   prepareDeleteIndexes.add(index);
               } else {
                   leftIndices.add(index);
               }
           }
   - 
   修改代码:ElasticSearchClient.java
   
   public boolean indexDocIsZero(String tableName) throws IOException {
           SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
           SearchRequest rq = new SearchRequest();
           //索引
           rq.indices(tableName);
           //各种组合条件
           rq.source(sourceBuilder);
           //其实位置
           sourceBuilder.from(0);
           //每页数量
           sourceBuilder.size(1);
           SearchResponse search = client.search(rq);
           return search.getHits().totalHits==0;
       }


-- 
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] [skywalking] wu-sheng commented on issue #7152: skywalking stored on elasticsearch and create too many index ,and index doc count is zero

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #7152:
URL: https://github.com/apache/skywalking/issues/7152#issuecomment-865505929


   There would no index should be empty, unless you are facing a very low load system.  I can't see why you are asking about deleting indices. But once you are doing it in your private fork, you could do anything you want. Again, this seems not a community concern.
   
   SkyWalking doesn't create index if there is no data, except the day one when the system installed. 


-- 
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] [skywalking] wu-sheng closed issue #7152: skywalking stored on elasticsearch and create too many index ,and index doc count is zero

Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #7152:
URL: https://github.com/apache/skywalking/issues/7152


   


-- 
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] [skywalking] xuanyuan1hao commented on issue #7152: skywalking stored on elasticsearch and create too many index ,and index doc count is zero

Posted by GitBox <gi...@apache.org>.
xuanyuan1hao commented on issue #7152:
URL: https://github.com/apache/skywalking/issues/7152#issuecomment-865491037






-- 
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] [skywalking] xuanyuan1hao commented on issue #7152: skywalking stored on elasticsearch and create too many index ,and index doc count is zero

Posted by GitBox <gi...@apache.org>.
xuanyuan1hao commented on issue #7152:
URL: https://github.com/apache/skywalking/issues/7152#issuecomment-865493147


   ok, thanks ,i will  talk use english


-- 
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] [skywalking] wu-sheng commented on issue #7152: skywalking stored on elasticsearch and create too many index ,and index doc count is zero

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #7152:
URL: https://github.com/apache/skywalking/issues/7152#issuecomment-865485473


   I don't know which version are you talking about. Could you be more clear when you ask a question. Putting some codes here is not making sense.


-- 
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] [skywalking] wu-sheng commented on issue #7152: skywalking stored on elasticsearch and create too many index ,and index doc count is zero

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #7152:
URL: https://github.com/apache/skywalking/issues/7152#issuecomment-865492137


   If you want to talk with the Community on the GitHub. We have to ask you to use English, to make the global people readable.
   Anyway, can't see your point, seems not a community level question.


-- 
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] [skywalking] wu-sheng commented on issue #7152: skywalking stored on elasticsearch and create too many index ,and index doc count is zero

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #7152:
URL: https://github.com/apache/skywalking/issues/7152#issuecomment-865485473






-- 
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] [skywalking] xuanyuan1hao commented on issue #7152: skywalking stored on elasticsearch and create too many index ,and index doc count is zero

Posted by GitBox <gi...@apache.org>.
xuanyuan1hao commented on issue #7152:
URL: https://github.com/apache/skywalking/issues/7152#issuecomment-865492463


   正确代码应该如下:
   public boolean indexDocIsZero(String tableName,RestHighLevelClient client) throws IOException {
           SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
           sourceBuilder.from(0);
           sourceBuilder.size(1);
           SearchRequest rq = new SearchRequest();
           rq.indices(tableName);
           rq.source(sourceBuilder);
           SearchResponse search = client.search(rq);
           return search.getHits().getHits().length==0;
       }


-- 
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] [skywalking] wu-sheng closed issue #7152: skywalking stored on elasticsearch and create too many index ,and index doc count is zero

Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #7152:
URL: https://github.com/apache/skywalking/issues/7152


   


-- 
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] [skywalking] xuanyuan1hao commented on issue #7152: skywalking stored on elasticsearch and create too many index ,and index doc count is zero

Posted by GitBox <gi...@apache.org>.
xuanyuan1hao commented on issue #7152:
URL: https://github.com/apache/skywalking/issues/7152#issuecomment-865491037


   sorry, 我这里的代码有点问题,主要意思就是看1天以前建立的索引库是否为空的索引库,如果是的话就删除了,留着没什么用。


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