ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

国产信创适配问题总结

国产信创适配问题总结 一、服务器操作系统麒麟 Kylin V10 国产操作系统内核版本4.19.90CPU 架构鲲鹏 920ARM64 架构二、数据库GreatDB 万里商业版数据库版本号8.0.32-23-GreatDB1.0.0.6118032-GA-1三、部署架构: 信创版本nacos、k8m查看服务及日志界面具体部署界面 jeckins四、处理过程创建命名空间指令 kubectl create namespace test-keshang查看命名空间 kubectl get ns在k8m上可以查看命名空间编码 36d4db4f-598e-4e86-b8fa-5cb5da80416d以下是命名空间配置文件---apiVersion:v1kind:Namespacemetadata:name:test-jgpt---apiVersion:v1kind:Secretmetadata:name:default-project-docker-secretnamespace:test-jgpttype:kubernetes.io/dockerconfigjsondata:.dockerconfigjson:-eyJhdXRocy11111111111111111111111111111WZmNtVmhaR1Z5T210WWFqRXljemxvUVVScFp6QTFlRFJXVGxkRGRUazJaWEZ0VFhBd1prUjEifX19在命名空间下创建应用创建应用 helm install qichacha-api local-chart-repository/microservice--version0.6.0--namespace test-keshang-f 02_qichacha-api-values.yaml 参数说明--version0.6.0指定使用 Chart 模板的版本号 必须是仓库里真实存在的版本 不写就用最新版--namespace test-keshang 把应用安装到 test-keshang 命名空间 所有 Pod、Service 都在这个空间里 必须先创建好这个 ns-f 02_qichacha-api-values.yaml-f--values 使用自定义配置文件覆盖默认配置 里面写的是镜像地址、端口、资源、环境变量、nacos、数据库等 你这个应用的所有个性化配置都在这里 卸载应用 helm uninstall qichacha-api--namespace test-keshang应用的配置文件 02_qichacha-api-values.yaml# 使用k8m部署或者用helm命令# helm install qichacha-api local-chart-repository/microservice --version 0.6.0 --namespace test-keshang -f 02_qichacha-api-values.yaml# helm uninstall xxx-api --namespace test-keshang# 确认下是否卸载干净# helm list -n test-keshang# kubectl get all -n test-keshang# 查看命名空间 kubectl get ns# kubectl create namespace test-keshangreplicaCount:1image:# 镜像仓库地址默认为harbor.prod.ccgx.localrepository:harbor.test.ccgx.local# 镜像所属项目必填project:test# 镜像标签必填tag:v1.0.0-beta-arm64-1779432204446# 应用信息apps:# 应用名称英文建议为微服务的名称-name:xxx-api# 应用别名即应用的中文名称aliasName:xxx服务# 镜像配置image:# 镜像名称必填name:xxx-api# 环境变量env:-name:JAVA_TOOL_OPTIONS# 需要把project.name设置为微服务名称才能在nacos看到服务订阅者名称value:-Dproject.namexxx-api -XX:UseG1GC -Xms256m -Xmx4096m -XX:MaxMetaspaceSize128m commonEnv:spring.profiles.active:testserver.port:80spring.cloud.nacos.discovery.register-enabled:truespring.cloud.nacos.config.server-addr:nacos-headless.test-middleware.svc.cluster.local:8848spring.cloud.nacos.config.namespace:36d4db4f-598e-4e86-b8fa-5cb5da80416dspring.cloud.nacos.config.username:xxspring.cloud.nacos.config.password:xxxx# 资源限制resources:limits:cpu:8000mmemory:8192Mirequests:cpu:200mmemory:256Mi五、常见问题1、国产服务器的nacos注册不到1.1 先排查容器是否启动成功看下启动日志可能 缺少nacos的配置1.2 项目里的命名空间及nacos帐密是否正确2、信创环境下jeckins构建时node-sass 因为依赖python2如果容器上未安装且使用的最新版本的python3。报错信息如下warning node-sassnode-gyptarfstream1.0.12:Thispackageisno longer supported.warning node-sassnode-gypfstreamrimraf2.7.1:Rimrafversions priortov4are no longer supported[2/4]Fetchingpackages...warning url-loader1.1.2:Invalidbin fieldforurl-loader.[3/4]Linkingdependencies...warning vue-countup-v24.0.0has incorrect peer dependencycountup.jslatest.warning vue-countup-v24.0.0has incorrect peer dependencyvuelatest.warning sass-loader7.3.1has unmet peer dependencywebpack^3.0.0 || ^4.0.0.[4/4]Buildingfresh packages...error/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/node-sass:Commandfailed.Exitcode:1Command:node scripts/build.jsArguments:Directory:/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/node-sassOutput:Building:/usr/local/bin/node/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js rebuild--verbose--libsass_ext--libsass_cflags--libsass_ldflags--libsass_librarygyp info it workedifit endswithokgyp verb cli[gyp verb cli /usr/local/bin/node,gyp verb cli /home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js,gyp verb cli rebuild,gyp verb cli --verbose,gyp verb cli --libsass_ext,gyp verb cli --libsass_cflags,gyp verb cli --libsass_ldflags,gyp verb cli --libsass_library gyp verb cli]gyp info using node-gyp3.8.0gyp info using node14.21.3|linux|arm64 gyp verb command rebuild[]gyp verb command clean[]gyp verb clean removingbuilddirectory gyp verb command configure[]gyp verb check python checkingforPythonexecutablepython2in thePATHgyp verb which failedError:not found:python2 gyp verb which failed at getNotFoundError(/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:13:12)gyp verb which failed atF(/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:68:19)gyp verb which failed atE(/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:80:29)gyp verb which failed at/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:89:16gyp verb which failed at/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/isexe/index.js:42:5gyp verb which failed at/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/isexe/mode.js:8:5gyp verb which failed atFSReqCallback.oncomplete(fs.js:192:21)gyp verb which failed python2Error:not found:python2 gyp verb which failed at getNotFoundError(/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:13:12)gyp verb which failed atF(/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:68:19)gyp verb which failed atE(/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:80:29)gyp verb which failed at/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:89:16gyp verb which failed at/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/isexe/index.js:42:5gyp verb which failed at/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/isexe/mode.js:8:5gyp verb which failed atFSReqCallback.oncomplete(fs.js:192:21){gyp verb which failed code:ENOENTgyp verb which failed}gyp verb check python checkingforPythonexecutablepythonin thePATHgyp verb which failedError:not found:python gyp verb which failed at getNotFoundError(/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:13:12)gyp verb which failed atF(/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:68:19)gyp verb which failed atE(/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:80:29)gyp verb which failed at/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:89:16gyp verb which failed at/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/isexe/index.js:42:5gyp verb which failed at/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/isexe/mode.js:8:5gyp verb which failed atFSReqCallback.oncomplete(fs.js:192:21)gyp verb which failed pythonError:not found:python gyp verb which failed at getNotFoundError(/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:13:12)gyp verb which failed atF(/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:68:19)gyp verb which failed atE(/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:80:29)gyp verb which failed at/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:89:16gyp verb which failed at/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/isexe/index.js:42:5gyp verb which failed at/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/isexe/mode.js:8:5gyp verb which failed atFSReqCallback.oncomplete(fs.js:192:21){gyp verb which failed code:ENOENTgyp verb which failed}gypERR!configure error gypERR!stackError:Cant findPythonexecutablepython,you can set thePYTHONenv variable.gypERR!stack atPythonFinder.failNoPython(/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/node-sass/node_modules/node-gyp/lib/configure.js:484:19)gypERR!stack atPythonFinder.anonymous(/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/node-sass/node_modules/node-gyp/lib/configure.js:406:16)gypERR!stack atF(/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:68:16)gypERR!stack atE(/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:80:29)gypERR!stack at/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/which/which.js:89:16gypERR!stack at/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/isexe/index.js:42:5gypERR!stack at/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/isexe/mode.js:8:5gypERR!stack atFSReqCallback.oncomplete(fs.js:192:21)gypERR!SystemLinux4.19.90-89.11.v2401.ky10.aarch64 gypERR!command/usr/local/bin/node/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.jsrebuild--verbose--libsass_ext--libsass_cflags--libsass_ldflags--libsass_librarygypERR!cwd/home/jenkins/agent/workspace/test-ywzt/ywzt-business-data-ui/src/node_modules/node-sass gypERR!node-v v14.21.3gypERR!node-gyp-v v3.8.0gypERR!not okBuildfailedwitherrorcode:1处理方式修改 node-sass 替换为 “sass”: “^1.32.0”, sass-load版本改为 “sass-loader”: “^10.0.0”,如果还报错尝试css: {extract: { ignoreOrder: true },loaderOptions: {sass: {additionalData: “$publicPath: ” process.env.VUE_APP_PUBLIC_PATH “;”,// 抑制 Dart Sass 弃用警告不影响编译仅减少控制台刷屏sassOptions: {silenceDeprecations: [“legacy-js-api”, “import”],},},},},如果还报错将样式的深度搜索改为/deep/ 换成 ::v-deep3、如果请求接口提示 404报错如图说明你启动的服务未注册到nacos在服务列表上查找4、执行jeckens 发现缺少docker-file-keyMasking supported pattern matches of$DOCKER_PASSWORD[Pipeline]{[Pipeline]shWarning: A secret was passed toshusing Groovy String interpolation,whichis insecure. Affected argument(s)used the following variable(s):[DOCKER_PASSWORD]See https://jenkins.io/redirect/groovy-string-interpolationfordetails. buildah login harbor.test.ccgx.local-upipeline --password-stdin echo**** Login Succeeded![Pipeline]}[Pipeline]// withCredentials[Pipeline]}[Pipeline]// container[Pipeline]}[Pipeline]// stage[Pipeline]stage[Pipeline]{(write dockerfile)[Pipeline]dirRunningin/home/jenkins/agent/workspace/test-fss/gxjt-rpa/docker[Pipeline]{[Pipeline]libraryResource[Pipeline]}[Pipeline]//dir[Pipeline]}[Pipeline]// stage[Pipeline]}[Pipeline]// script[Pipeline]}[Pipeline]// stage[Pipeline]}[Pipeline]// container[Pipeline]}[Pipeline]//node[Pipeline]}[Pipeline]// podTemplate[Pipeline]End of Pipeline ERROR: No such library resource docker/backend/ms-java8u342-arm64/Dockerfile could be found. Finished: FAILURE原因这两个地方的key值不一致导致报错。
返回列表