iis

.NET Core微服务之基于Consul实现服务治理

白昼怎懂夜的黑 提交于 2021-02-12 22:40:46
Tip: 此篇已加入 .NET Core微服务基础系列文章索引 一、Consul基础介绍   Consul是HashiCorp公司推出的开源工具,用于实现分布式系统的服务发现与配置。与其他分布式服务注册与发现的方案,比如 Airbnb的SmartStack等相比,Consul的方案更“一站式”,内置了服务注册与发现框 架、分布一致性协议实现、健康检查、Key/Value存储、多数据中心方案,不再需要依赖其他工具(比如ZooKeeper等),使用起来也较 为简单。   Consul用Golang实现,因此具有天然可移植性(支持Linux、windows和Mac OS X);安装包仅包含一个可执行文件,方便部署,与Docker等轻量级容器可 无缝配合 。   关于Consul的更多介绍,比如优点,这里就不再赘述了,上网一搜就可以随处找到了。但是,必须贴一个和其他类似软件的对比:   此外,关于Consul的架构以及相关的角色,如下图所示:   要想利用Consul提供的服务实现服务的注册与发现,我们需要建立Consul Cluster。在Consul方案中,每个提供服务的节点上都要部署和运行Consul的Client Agent,所有运行Consul Agent节点的集合构成Consul Cluster。Consul Agent有两种运行模式: Server 和 Client

MySQL 查询结果保存为CSV文件

馋奶兔 提交于 2021-02-12 09:16:31
点击上方“ IT共享之家 ”,进行关注 回复“ 资料 ”可获赠IT学习福利 MySQL支持将查询结果直接导出为文本格式,格式如下: into outfile ‘导出的目录和文件名’ 指定导出的目录和文件名 fields terminated by ‘字段间分隔符’ 定义字段间的分隔符 optionally enclosed by ‘字段包围符’ 定义包围字段的字符(数值型字段无效) lines terminated by ‘行间分隔符’ 定义每行的分隔符 举个栗子: select * from [表名] where [字段名] = '条件' into outfile 'c:/test.csv' fields terminated by ',' optionally enclosed by '"' lines terminated by '\r\n' ; 执行后,会把指定表中记录数据导出到c:/test.csv文件中。每个字段以,(逗号)分隔,字段内容是字符串的以”(双引号)包围,每条记录使用\r\n换行。如图所示 如果导出的过程中出现: the MySQL server is running with the -- secure - file - priv option so it cannot execute this statement 首先了解一下secure-file

winform 利用Http向服务器上传与下载文件

与世无争的帅哥 提交于 2021-02-12 05:39:11
  利用在服务器端的IIS,布置“请求处理映射”。从而处理,本地发出Post请求。Url指向web网站所在路径的请求映射。由映射代码实现服务器保存文件。   winform里面使用,WebClient的对象,完成Url请求;    winform代码:文件保存的地址为服务器网站根目录下的files文件夹(需要提前创建)/ OpenFileDialog fileDialog = new OpenFileDialog { Multiselect = false , Title = " 请选择文件 " , Filter = " 所有文件(*.*)|*.* " }; if (fileDialog.ShowDialog() == DialogResult.OK) { try { string path = Path.GetFullPath(fileDialog.FileName); // 绝对路径 // 显示文件路径 string fileName = Path.GetFileName(fileDialog.FileName); WebClient wc = new WebClient(); wc.Credentials = CredentialCache.DefaultCredentials; wc.Headers.Add( " Content-Type " , " application

Can't get dash app run on IIS with flask server

徘徊边缘 提交于 2021-02-11 18:10:19
问题 I have two websites (both are using Dash & Flask) on my IIS (Windows Server 2016). The first one is a minimal working example consisting of app.py and web.config. For somehow I cannot get the second site working. Below both examples and the error message is attached. 1 Working Example FastCGI-Settings: PYTHONPATH: C:\inetpub\wwwroot\mvp WSGI_HANDLER: app.server app.py import flask import dash import dash_core_components as dcc import dash_html_components as html server = flask.Flask(__name__)

Can't get dash app run on IIS with flask server

依然范特西╮ 提交于 2021-02-11 18:07:33
问题 I have two websites (both are using Dash & Flask) on my IIS (Windows Server 2016). The first one is a minimal working example consisting of app.py and web.config. For somehow I cannot get the second site working. Below both examples and the error message is attached. 1 Working Example FastCGI-Settings: PYTHONPATH: C:\inetpub\wwwroot\mvp WSGI_HANDLER: app.server app.py import flask import dash import dash_core_components as dcc import dash_html_components as html server = flask.Flask(__name__)

IIS 7 - Rewrite rule not firing, but does work with Redirect

风流意气都作罢 提交于 2021-02-11 17:58:29
问题 I have the following rewrite rule set up on IIS 7: <rule name="Rewrite /publicfiles/GUID/file.ext" stopProcessing="true"> <match url="^/?publicfiles/(.*)/(.*)" /> <action type="Rewrite" url="http://www.domain.tld" appendQueryString="false" / </rule> When I try it out it appears to not fire. I get a 404 error, but if I change the type to Redirect it fires and sends me to the URL specified. Is someone able to shed some light on this? EDIT: I added the definition of the rule to the web.config of

Configure 2 sites in the IIS of windows Server 2016

时间秒杀一切 提交于 2021-02-11 17:40:39
问题 I have to configure a staging site of my web application in Windows Server 2016. I have ASP.net site which is running smoothly in my win server 2016, and I have configured A record from my bluehost DNS Manager. My Question: I want to add a new site in the IIS of my server using same port. So how I could manage to reach it from A record or CNAME record from bluehost? 回答1: As far as I know, IIS doesn’t allow two websites to use the same port number when we using the same alias for the local

Configure 2 sites in the IIS of windows Server 2016

空扰寡人 提交于 2021-02-11 17:40:30
问题 I have to configure a staging site of my web application in Windows Server 2016. I have ASP.net site which is running smoothly in my win server 2016, and I have configured A record from my bluehost DNS Manager. My Question: I want to add a new site in the IIS of my server using same port. So how I could manage to reach it from A record or CNAME record from bluehost? 回答1: As far as I know, IIS doesn’t allow two websites to use the same port number when we using the same alias for the local

Deleting an environmental variable for IIS

老子叫甜甜 提交于 2021-02-11 16:55:57
问题 I've understood that, in order to make IIS read a new environmental variable, I have to reset it via an administrator's command: iireset /restart I know that one can also restart IIS from the admin panel at server level. More context to my complete web app setup in my previous question/answer: in brief it is a Python Flask app running on IIS through WSGI and FastCGI. What is still surprising me is that now, if I delete a previously created environmental variable, IIS keep seeing it, even

SqlException: Login failed for user 'DOMAIN\MACHINENAME$' for SQL Server with .NET Core 2.1

谁都会走 提交于 2021-02-11 15:51:47
问题 Here is the contents of my connection string. It is an .NET Core 2.1 web application. When I run on my PC, it works fine. When I deploy it to IIS and run it, this error will occur. The detailed error is after the appsetting. "Testing2012Context": "Server=Server;Database=Testing2012;User ID=User;Password=Pwd;Trusted_Connection=False;MultipleActiveResultSets=true" Error: SqlException: Login failed for user 'DOMAIN\MACHINENAME$' for the SQL Server with .NET Core 2.1 ... System.Data.SqlClient