学习怎么做网站,中国新闻社山西分社,WordPress判断手机输出,wordpress 引用文件appsmith安装好#xff0c;那就可以看是练练手。 数据当然是来自数据库#xff0c;那就连接局域网中现成的一台数据库服务器试试#xff0c;但是连接数据库的时候一直错误。 找到/home/appsmith/backend 目录下的日志#xff0c;看到了错误#xff1a; [rootlocalhost bac…appsmith安装好那就可以看是练练手。 数据当然是来自数据库那就连接局域网中现成的一台数据库服务器试试但是连接数据库的时候一直错误。 找到/home/appsmith/backend 目录下的日志看到了错误 [rootlocalhost backend]# ls backend-29a34aa6233c.log starting_page_init.log
Failed to initialize pool: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]. ClientConnectionId:f04af734-f327-4959-93af-3f6f051284c2 Exception occurred while creating connection pool. One or more arguments in the datasource configuration may be invalid. Please check your datasource configuration. 一阵查询在微软文档上找到了这个错误描述。 在 encrypt 属性为 true 且 trustServerCertificate 属性为 false 的情况下如果连接字符串中的服务器名称与 TLS 证书中的服务器名称不符则会出现以下错误The driver couldnt establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: java.security.cert.CertificateException: Failed to validate the server name in a certificate during Secure Sockets Layer (SSL) initialization. 。 在版本 7.2 及以上版本中驱动程序在 TLS 证书的服务器名称最左边的标签中支持通配符模式匹配。
很显然这个回答方向不对一堆废话appsmith不至于如此菜 回头去看appsmith的文档原来如此appsmith根本不支持这样的数据库连接方式。本地部署时它连接数据有三种方式 ********************************** Connect to Local Datasource This page describes how to connect a database or API that is hosted locally on the same machine as your Appsmith instance.
Datasource on localhost: There are two methods:1.ngrok(Recommended): To connect to a local datasource on a self-hosted or an Appsmith cloud instance, expose the datasource via ngrok. For directions, see ngrok.2.host.docker.internal: This method is only for self-hosted users for connecting from the Docker container to a datasource on localhost. This is for development purposes and does not work in a production environment outside of Docker Desktop. For directions, see host.docker.internal.3.Datasource in Docker container: This guide is only for self-hosted users for connecting to a datasource in a Docker container. For directions, see Datasource in Docker ********************************** ngrok不喜欢host.docker.internal我也不喜欢幸好还有第三种方式连接另外一个容器中的数据源。
那就开始安装sql server容器。步骤一.创建数据存储目录,希望创建的数据库文件不要因为删除容器而被失误删除 [rootlocalhost home]# mkdir /home/sql_db_files
步骤二下载镜像 [rootlocalhost home]# docker pull mcr.microsoft.com/mssql/server:2022-latest
步骤三创建容器 [rootlocalhost home]# docker run -e ACCEPT_EULAY -e MSSQL_SA_PASSWORD2024Passw0rd \ -v /home/sql_db_files:/var/opt/mssql \ -p 1433:1433 --name mssql --hostname mssql2022 \ -e MSSQL_PIDExpress \ -e MSSQL_COLLATIONChinese_PRC_BIN \ -e TZAsia/Shanghai \ -d \ mcr.microsoft.com/mssql/server:2022-latest 参数说明 ACCEPT_EULA confirms your acceptance of the End-User Licensing Agreement. MSSQL_SA_PASSWORD is the database system administrator (userid sa) password used to connect to SQL Server once the container is running. 这个SA密码必须要符合复杂度要求 MSSQL_PID is the Product ID (PID) or Edition that the container will run with. Acceptable values: Developer : This will run the container using the Developer Edition (this is the default if no MSSQL_PID environment variable is supplied)Express : This will run the container using the Express Edition Standard : This will run the container using the Standard Edition Enterprise : This will run the container using the Enterprise Edition EnterpriseCore : This will run the container using the Enterprise Edition Core
步骤四查看容器安装结果 [rootlocalhost home]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 19472a5fbb97 mcr.microsoft.com/mssql/server:2022-latest /opt/mssql/bin/perm… 45 seconds ago Exited (1) 44 seconds ago mssql 29a34aa6233c appsmith/appsmith-ce /opt/appsmith/entry… 7 days ago Up 7 days (healthy) 0.0.0.0:80-80/tcp, :::80-80/tcp, 0.0.0.0:443-443/tcp, :::443-443/tcp appsmith ba7d6e626f06 hello-world /hello 2 weeks ago Exited (0) 2 weeks ago practical_hofstadter 2948ab27c7ce hello-world /hello 2 weeks ago Exited (0) 2 weeks ago cool_ritchie [rootlocalhost home]# 看起来不对劲看看日志原来处在目录权限上。 [rootlocalhost docker]# docker logs -f --until60s mssql SQL Server 2022 will run as non-root by default. This container is running as user mssql. To learn more visit https://go.microsoft.com/fwlink/?linkid2099216. /opt/mssql/bin/sqlservr: Error: The system directory [/.system] could not be created. File: LinuxDirectory.cpp:420 [Status: 0xC0000022 Access Denied errno 0xD(13) Permission denied]
修改存放数据目录的权限设置 [rootlocalhost docker]# chmod 777 /home/sql_db_files
步骤五: 重新安装容器 [rootlocalhost docker]# [rootlocalhost home]# docker run -d --name mssql --hostname mssql\ -v /home/sql_db_files:/var/opt/mssql \ -p 1433:1433 \ -e ACCEPT_EULAY -e MSSQL_SA_PASSWORD2024Passw0rd \ -e TZAsia/Shanghai \ -e MSSQL_PIDExpress \ -e MSSQL_COLLATIONChinese_PRC_BIN \ mcr.microsoft.com/mssql/server:2022-latest docker: Error response from daemon: Conflict. The container name /mssql is already in use by container 19472a5fbb977a9b707b6f4b5895d989370b61007f7a9f19f96265ad48c1e2a2. You have to remove (or rename) that container to be able to reuse that name. See docker run --help. 刚才没有安装成功导致那就删除 [rootlocalhost docker]# docker rm -f mssql
重新再安装后没出错再查看终于成功了 不可否认这Docker安装速度快的要死比起在操作系统上安装sql server 不知道要快多少倍。
[rootlocalhost docker]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b5b29ae870fd mcr.microsoft.com/mssql/server:2022-latest /opt/mssql/bin/perm… 25 seconds ago Up 24 seconds 0.0.0.0:1433-1433/tcp, :::1433-1433/tcp mssql 29a34aa6233c appsmith/appsmith-ce /opt/appsmith/entry… 7 days ago Up 7 days (healthy) 0.0.0.0:80-80/tcp, :::80-80/tcp, 0.0.0.0:443-443/tcp, :::443-443/tcp appsmith ba7d6e626f06 hello-world /hello 2 weeks ago Exited (0) 2 weeks ago practical_hofstadter 2948ab27c7ce hello-world /hello 2 weeks ago Exited (0) 2 weeks ago cool_ritchie
步骤六连接数据库修改sa密码 [rootlocalhost docker]# docker exec -it mssql bash mssqlmssql2022:/$ /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 2024Passw0rd 1 alter login sa with password 2025Passw0rd 2 ; 3 quit mssqlmssql2022:/$ exitexit
可以使用sql server 管理控制台成功连接容器中的数据库了但是在appsmith中连接时没有反应错误日志为连接错误 [2024-01-30 00:25:52,186] userEmailttapp.com, sessionIdb99a2476-5c35-4a71-9e8e-25c9c3292cfa, threadboundedElastic-38, requestIdea262c1d-722b-4176-aac7-4b062d7066b6 - Operator called default onErrorDropped com.appsmith.external.exceptions.pluginExceptions.AppsmithPluginException: Exception occurred while creating connection pool. One or more arguments in the datasource configuration may be invalid. Please check your datasource configuration. 看不出所以然, 真是路漫漫啊