Giter VIP home page Giter VIP logo

Comments (5)

starsliao avatar starsliao commented on August 24, 2024

你好,目前在web界面和批量导入的时候是采用控制部分特殊字符的方式,防止特殊字符写入ServiceID,比如会禁止开头结尾的/等等。

感谢你的建议,后面修改成PUT data的方式来删除服务。

所有云资源都会定时同步,在接入云厂商菜单中,可以看到同步的情况,目前云主机列表菜单可以修改云资源的IP端口,不会被同步覆盖。

from tensuns.

starsliao avatar starsliao commented on August 24, 2024

如果字段里有控制字符,如/ \t 之类的,无法在后台删除,会报400错误;

通过curl调consul的url方式也无法删除,也返回400错误。 只能通过json的方式删除: curl -s -X PUT -d '{"Node": "your_node", "ServiceID": "/service_with_slash"}' http://consul.service.consul:8500/v1/catalog/deregister

所以建议ConsulManager删除consul的服务的时候,也使用json的方式删除,兼容字符里有控制字符的情况。

我现在有办法删除consul里的服务实例,但是删除之后马上就恢复了,不知是不是ConsulManager有定时任务会把自己的数据再同步到consul里?

我测试了下,通过json的方式删除后,consul过一会儿又会出现这个ServiceID,这并不是consulmanager同步过来的,自建主机没有同步的操作,还需要确认下consul的这个接口是否能删除掉ServiceID。

from tensuns.

warsk29 avatar warsk29 commented on August 24, 2024

如果字段里有控制字符,如/ \t 之类的,无法在后台删除,会报400错误;
通过curl调consul的url方式也无法删除,也返回400错误。 只能通过json的方式删除: curl -s -X PUT -d '{"Node": "your_node", "ServiceID": "/service_with_slash"}' http://consul.service.consul:8500/v1/catalog/deregister
所以建议ConsulManager删除consul的服务的时候,也使用json的方式删除,兼容字符里有控制字符的情况。
我现在有办法删除consul里的服务实例,但是删除之后马上就恢复了,不知是不是ConsulManager有定时任务会把自己的数据再同步到consul里?

我测试了下,通过json的方式删除后,consul过一会儿又会出现这个ServiceID,这并不是consulmanager同步过来的,自建主机没有同步的操作,还需要确认下consul的这个接口是否能删除掉ServiceID。

我试了下,同步是因为agent同步到了catalog,我无论如何都无法通过api或者cli删除agent里的服务,所以只能在consul的services目录里,将相关的文件给删除了。我也发现,只要consul消除了,consulmanager也同步消失了,确认不是consulmanager同步过去的。
所以我想即使你用put通过catalog去删除应该也无法解决这个问题。因为无法删除agent里的服务,然后即使通过put方式删除了catalog的服务,也会被agent同步过来。
所以建议在consulmanager端在插入consul前,通知用户过滤掉service名字的所有特殊字符,我前几天又输入了一个特殊字符的服务名,是最后带有\t,比如xxls\t这样的。

from tensuns.

warsk29 avatar warsk29 commented on August 24, 2024

你好,目前在web界面和批量导入的时候是采用控制部分特殊字符的方式,防止特殊字符写入ServiceID,比如会禁止开头结尾的/等等。

你好,这个貌似没有过滤字符串尾有\t的情况,因为我前几天又不小心插入了一个这样的服务。

from tensuns.

starsliao avatar starsliao commented on August 24, 2024

已修复。

from tensuns.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.