Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎样开启mcp #4429

Closed
wanghuigithub opened this issue Dec 8, 2020 · 8 comments · Fixed by #4677
Closed

怎样开启mcp #4429

wanghuigithub opened this issue Dec 8, 2020 · 8 comments · Fixed by #4677
Assignees
Labels
kind/bug Category issues or prs related to bug.

Comments

@wanghuigithub
Copy link

使用k8s部署,怎样开启mcp

@chuntaojun
Copy link
Collaborator

nacos.istio.mcp.server.enabled=false

@chuntaojun chuntaojun added the kind/question Category issues related to questions or problems label Dec 8, 2020
@wanghuigithub
Copy link
Author

nacos.istio.mcp.server.enabled=false
使用k8s部署。直接修改home/nacos/conf/application.properties这个文件?
怎样观察已开启

@KomachiSion
Copy link
Collaborator

可以看一下官方镜像是否有环境变量可以修改这个值,如果不行,请参考官方镜像的example, 自行build镜像,build镜像时可以把这个参数在镜像中调整,这样就可以支持k8s了。

@wanghuigithub
Copy link
Author

可以看一下官方镜像是否有环境变量可以修改这个值,如果不行,请参考官方镜像的example, 自行build镜像,build镜像时可以把这个参数在镜像中调整,这样就可以支持k8s了。

嗯嗯 我现在已经重新打了镜像并且加上了参数。 现在不知道观察什么指标来确认。mcp已经被开启了

@wanghuigithub
Copy link
Author

wanghuigithub commented Dec 9, 2020

可以看一下官方镜像是否有环境变量可以修改这个值,如果不行,请参考官方镜像的example, 自行build镜像,build镜像时可以把这个参数在镜像中调整,这样就可以支持k8s了。

使用nacos-docker项目重新打了镜像。做了如下修改:
配置文件中增加了nacos.istio.mcp.server.enabled=true
image

但是在istio-main.log中没有打印mcp server启动的日志。
这条日志:Loggers.MAIN.info("MCP server, starting Nacos MCP server...");没有打印

@wsx812585705
Copy link

IstioConfig类中 final boolean mcpServerEnabled = false, 本地调试发现设置了nacos.istio.mcp.server.enabled=true,
启动NacosMcpServer
if (!istioConfig.isMcpServerEnabled()) {
return;
}
还是会return,
在ISSUE#2992提交中新增的final修饰。这是否是个bug.

@wanghuigithub
Copy link
Author

IstioConfig类中 final boolean mcpServerEnabled = false, 本地调试发现设置了nacos.istio.mcp.server.enabled=true,
启动NacosMcpServer
if (!istioConfig.isMcpServerEnabled()) {
return;
}
还是会return,
在ISSUE#2992提交中新增的final修饰。这是否是个bug.

其实在nacos-docker项目中,配置文件没有被正确读取到。所以配置不会生效。我直接更改的代码,把代码中默认的false改为了true。并重新打包,构建镜像。问题解决

@LoseyourseIf
Copy link

IstioConfig类中 final boolean mcpServerEnabled = false, 本地调试发现设置了nacos.istio.mcp.server.enabled=true,
启动NacosMcpServer
if (!istioConfig.isMcpServerEnabled()) {
return;
}
还是会return,
在ISSUE#2992提交中新增的final修饰。这是否是个bug.

其实在nacos-docker项目中,配置文件没有被正确读取到。所以配置不会生效。我直接更改的代码,把代码中默认的false改为了true。并重新打包,构建镜像。问题解决

nacos-docker 可以配置挂载 custom.properties 开启 MCP
根本问题是 IstioConfig.java
mcpServerEnabled 被 final 修饰了

@Value("${nacos.istio.mcp.server.enabled:false}")
private final boolean mcpServerEnabled = false;

1.3.0 以后的版本只有自己修改代码打包镜像

@KomachiSion KomachiSion added kind/bug Category issues or prs related to bug. and removed kind/question Category issues related to questions or problems labels Jan 12, 2021
@chuntaojun chuntaojun linked a pull request Jan 12, 2021 that will close this issue
chuntaojun added a commit that referenced this issue Jan 12, 2021
[ISSUE #4429] Fix mcp  can't be open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants