appsmith安装手记:4.Sql server数据库容器安装

appsmith安装好,那就可以看是练练手。
数据当然是来自数据库,那就连接局域网中现成的一台数据库服务器试试,但是连接数据库的时候一直错误。

找到/home/appsmith/backend 目录下的日志,看到了错误:
[root@localhost 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 couldn't 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容器。
步骤一.创建数据存储目录,希望创建的数据库文件不要因为删除容器而被失误删除
[root@localhost home]# mkdir /home/sql_db_files

步骤二:下载镜像
[root@localhost home]# docker pull mcr.microsoft.com/mssql/server:2022-latest

步骤三:创建容器
[root@localhost home]# docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=2024@Passw0rd" \
   -v  /home/sql_db_files:/var/opt/mssql \
   -p 1433:1433 --name mssql --hostname mssql2022 \
   -e "MSSQL_PID=Express" \
   -e "MSSQL_COLLATION=Chinese_PRC_BIN" \
   -e "TZ=Asia/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

步骤四:查看容器安装结果
[root@localhost 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
[root@localhost home]# 
看起来不对劲,看看日志,原来处在目录权限上。
[root@localhost docker]# docker logs -f --until=60s 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/?linkid=2099216.
/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]

修改存放数据目录的权限设置:
[root@localhost docker]# chmod 777 /home/sql_db_files

步骤五: 重新安装容器
[root@localhost docker]# [root@localhost home]# docker run -d --name mssql --hostname  mssql\
-v  /home/sql_db_files:/var/opt/mssql \
-p 1433:1433  \
-e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=2024@Passw0rd" \
-e "TZ=Asia/Shanghai" \
-e "MSSQL_PID=Express" \
-e "MSSQL_COLLATION=Chinese_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'.
刚才没有安装成功导致,那就删除
[root@localhost docker]# docker rm -f mssql

重新再安装后没出错,再查看,终于成功了
不可否认,这Docker安装速度快的要死,比起在操作系统上安装sql server 不知道要快多少倍。

[root@localhost 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密码
[root@localhost docker]# docker exec -it mssql "bash"
mssql@mssql2022:/$ /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 2024@Passw0rd
1> alter login sa with password 2025@Passw0rd
2> ;
3> quit

mssql@mssql2022:/$ exit
exit

可以使用sql server 管理控制台成功连接容器中的数据库了,但是在appsmith中连接时没有反应,错误日志为:连接错误
[2024-01-30 00:25:52,186] userEmail=tt@app.com, sessionId=b99a2476-5c35-4a71-9e8e-25c9c3292cfa, thread=boundedElastic-38, requestId=ea262c1d-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.
看不出所以然, 真是路漫漫啊!
 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/659089.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

uniapp如何引入uview组件?

目录 1.引入前准备 2.在项目中引入组件 1.mian.is文件 2.uni.scss 文件 3.App.vue文件 4.pages.json 文件 3.测试成功 1.引入前准备 为了方便我们在制作项目的过程中,方便使用模板组件,快速开发。我们可以选择引入组件。 在uni-app中使用uView组件…

day22打卡

day22打卡 235. 二叉搜索树的最近公共祖先 递归法时间复杂度:O(N),空间复杂度:O(N) class Solution { public:TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {if(root->val > p->val && ro…

蓝桥杯《剪格子》

题目描述 历届试题 剪格子 时间限制:1.0s 内存限制:256.0MB 问题描述 如下图所示,3 x 3 的格子中填写了一些整数。 10 1 52 20 30 1 1 2 3 我们沿着图中的星号线剪开,得到两个部分,每个部分…

基于SSM的高校班级同学录网站设计与实现(有报告)。Javaee项目,ssm项目。

演示视频: 基于SSM的高校班级同学录网站设计与实现(有报告)。Javaee项目,ssm项目。 项目介绍: Javaee项目,采用M(model)V(view)C(controller&…

双非本科准备秋招(12.2)—— 力扣栈与队列

复习一下栈和队列的基础知识&#xff0c;刷几道题上上手。 1、102. 二叉树的层序遍历 广度优先遍历嘛&#xff0c;每次拓展一个新结点&#xff0c;就把新结点加入队列&#xff0c;这样遍历完队列中的元素&#xff0c;顺序就是层序遍历。 class Solution {public List<Lis…

我国个体工商户达1.24亿户,支撑近3亿人就业

官媒报道截至2023年底&#xff0c;全国登记在册个体工商户1.24亿户&#xff0c;占经营主体总量的67.4%&#xff0c;支撑近3亿人就业。 什么概念&#xff1f;我帮大家理解一下&#xff0c;2024年了&#xff0c;现在中国5个人里面就有一个人不用上班&#xff0c;而是自己当起了老…

Linux 内核学习1. 编译并启动一个最小化系统

Linux 内核学习1. 编译并启动一个最小化系统 一、Linux内核简介1. Linux 内核介绍2. Linux内核主要的作用 二、编译内核主要的步骤三、编译过程1. 准备环境2. 安装编译工具和依赖项3. 下载源码4. 配置内核配置功能选项命令行配置图形化配置默认配置 5. 编译内核6. 构建轻量化工…

C语言-算法-树状数组

统计和 题目描述 给定一个长度为 n ( n ≤ 100000 ) n(n\leq 100000) n(n≤100000)&#xff0c;初始值都为 0 0 0 的序列&#xff0c; x ( x ≤ 100000 ) x(x\leq 100000) x(x≤100000) 次的修改某些位置上的数字&#xff0c;每次加上一个数&#xff0c;然后提出 y ( y ≤…

mysql 允许其他ip访问

1.改表法。 可能是你的帐号不允许从远程登陆&#xff0c;只能在localhost。这个时候只要在localhost的那台电脑&#xff0c;登入mysql后&#xff0c;更改 “mysql” 数据库里的 “user” 表里的 “host” 项&#xff0c;从"localhost"改称"%" //执行以下…

#翻转牛群

题目描述 农夫约翰偶尔会遇到无聊的青少年&#xff0c;他们晚上去他的农场&#xff0c;把奶牛们弄翻。一天早上&#xff0c;他醒来发现事情又发生了——他的 N∗N 头奶牛排列成了一个完美的 N∗N 方阵&#xff08;1≤N≤10)&#xff0c;但他发现其中一些现在已经被弄翻了&…

学习使用Flask模拟接口进行测试

前言 学习使用一个新工具&#xff0c;首先找一段代码学习一下&#xff0c;基本掌握用法&#xff0c;然后再考虑每一部分是做什么的 Flask的初始化 app Flask(__name__)&#xff1a;初始化&#xff0c;创建一个该类的实例&#xff0c;第一个参数是应用模块或者包的名称 app…

免费使用支持离线部署使用的 txt2video 文本生成视频大模型(Text-to-Video-Synthesis Model)

免费使用支持离线部署使用的 txt2video 文本生成视频大模型(Text-to-Video-Synthesis Model)。 文本生成视频大模型(Text-to-Video-Synthesis Model)是一种基于深度学习技术的人工智能模型&#xff0c;它可以将自然语言文本描述转换为相应的视频。即通过输入文本描述&#xff…

MySQL 函数参考手册(MySQL 数值函数)

目录 MySQL ABS() 函数 MySQL ACOS() 函数 MySQL ASIN() 函数 MySQL ATAN() 函数 MySQL ATAN2() 函数 MySQL AVG() 函数 MySQL CEIL() 函数 MySQL CEILING() 函数 MySQL COS() 函数 MySQL COT() 函数 MySQL COUNT() 函数 MySQL DEGREES() 函数 MySQL DIV 函数 My…

远程连接服务器:Ping通但SSH连接失败的解决办法

写在前面&#xff1a;本博客仅作记录学习之用&#xff0c;部分图片来自网络&#xff0c;如需引用请注明出处&#xff0c;同时如有侵犯您的权益&#xff0c;请联系删除&#xff01; 文章目录 前言常见问题影响SSH的因素本地影响因素防火墙设置网络配置文件 远程主机影响因素放行…

HTML5画布绘制实心圆、三角形、五边形、五角星

场景 纯原生canvas绘制&#xff0c;可以自定义位置、颜色等信息。 实现 以下封装成方法&#xff0c;调用后传参即可。图形两角间边距暂时写死&#xff0c;可以自行加减参数来调整。 1.实心圆 function circular(x, y, radius, fillColor, strokeColor){ ctx.beginPath();//开始…

Python爬虫实践指南:利用cpr库爬取技巧

引言 在信息时代&#xff0c;数据是无价之宝。为了获取网络上的丰富数据&#xff0c;网络爬虫成为了不可或缺的工具。在Python这个强大的编程语言中&#xff0c;cpr库崭露头角&#xff0c;为网络爬虫提供了便捷而高效的解决方案。本文将深入探讨如何利用cpr库实现数据爬取的各…

西瓜书读书笔记整理(十二) —— 第十二章 计算学习理论(下)

第十二章 计算学习理论&#xff08;下&#xff09; 12.4 VC 维&#xff08;Vapnik-Chervonenkis dimension&#xff09;12.4.1 什么是 VC 维12.4.2 增长函数&#xff08;growth function&#xff09;、对分&#xff08;dichotomy&#xff09;和打散&#xff08;shattering&…

macOS 上使用 Sublime Text 删除全部空行

1、删除方法 1、打开搜索替换: 使用快捷键Command F打开查找功能。然后点击左下角的.*图标或使用快捷键Command Alt R来启用正则表达式搜索。 2、输入正则表达式: 在查找栏中输入以下正则表达式&#xff1a;^\s*\n 这个正则表达式匹配从行开始到行结束之间的所有空白字符…

扩展学习|商业智能和大数据分析的研究前景(比对分析)

文献来源&#xff1a; Liang T P , Liu Y H .Research Landscape of Business Intelligence and Big Data analytics: A bibliometrics study[J].Expert Systems with Applications, 2018, 111(NOV.):2-10.DOI:10.1016/j.eswa.2018.05.018. 信息和通信技术的快速发展导致了数字…

RocksDB是如何实现存算分离的

核心参考文献&#xff1a; Dong, S., P, S. S., Pan, S., Ananthabhotla, A., Ekambaram, D., Sharma, A., Dayal, S., Parikh, N. V., Jin, Y., Kim, A., Patil, S., Zhuang, J., Dunster, S., Mahajan, A., Chelluri, A., Datye, C., Santana, L. V., Garg, N., & Gawde,…