什么config.txt,什么nacos-config.sh,根据官方文档用脚本导了半天,都已经导入数据库里,nacos配置列表页面却啥也没有。。。
官方大坑:
这个 -t 是什么意思你知道吗?你不知道。进入nacos-config.sh查看,是tenant的意思,tenant又是什么你知道吗?你知道个毛,是命名空间!(namespace:???)23333333,阿里巴巴,yes!
所以如果你没有在nacos配置你自己的命名空间(默认有个public),那你就在脚本里干掉这个参数!它就会把配置放到默认空间下,就完事了
curl -X POST -H "${contentType}" "http://$nacosAddr/nacos/v1/cs/configs?dataId=$dataId&group=$group&content=$content&tenant=$tenant&username=$username&password=$password" >"${tempLog}" 2>/dev/null
但是!如果你自作聪明,新建了一个命名空间,比如’seata’,然后在执行脚本时加了上去:
sh ${SEATAPATH}/script/config-center/nacos/nacos-config.sh -h localhost -p 8848 -g SEATA_GROUP -t seata -u username -w password
呵呵,某卵用!这个tenant是并不是命名空间的名称,而是命名空间Id,LOL
千言万语汇成一句话:丢雷!