Example Configuration Directives proxy_bind proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_bypass proxy_cache_convert_head proxy_cache_key proxy_cache_lock proxy_cache_lock_age proxy_cache_lock_timeout proxy_cache_max_range_offset proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_purge proxy_cache_revalidate proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_cookie_domain proxy_cookie_path proxy_force_ranges proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_http_version proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_limit_rate proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_next_upstream_timeout proxy_next_upstream_tries proxy_no_cache proxy_pass proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_request_buffering proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_certificate proxy_ssl_certificate_key proxy_ssl_ciphers proxy_ssl_crl proxy_ssl_name proxy_ssl_password_file proxy_ssl_server_name proxy_ssl_session_reuse proxy_ssl_protocols proxy_ssl_trusted_certificate proxy_ssl_verify proxy_ssl_verify_depth proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path Embedded Variables The ngx_http_proxy_module module allows passing requests to another server. Example Configuration
|
1 2 3 4 5 |
location / { proxy_pass http://localhost:8000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } |
Directives Syntax: proxy_bind […]
View DetailsToday marks the 15th anniversary since .NET debuted to the world. On February 13th, 2002, the first version of .NET was released as part of Visual Studio.NET. It seems just like yesterday when Microsoft was building its “Next Generation Windows Services” and unleashed a new level of productivity with Visual Studio.NET. Since the beginning, the .NET platform has allowed developers to quickly build and deploy robust applications, starting with Windows desktop and web server applications in 2002. You got an entire managed framework for building distributed Windows applications, […]
View DetailsC#读取MySQL时,如果存在字段类型为date/datetime时的可能会出现以下问题 “Unable to convert MySQL date/time value to System.DateTime” 原因:可能是该字段(date/datetime)的值默认缺省值为:0000-00-00/0000-00-00 00:00:00,这样的数据读出来转换成System.DateTime时就会有问题; 解决办法: 1、将该字段的缺省值设置为null,而不是0000-00-00/0000-00-00 00:00:00的情况; 2、在链接MySQL的字符串中添加:Convert Zero Datetime=True 和 Allow Zero Datetime=True两个属性; 3、将该字段设置成字符串类型; 建议采用方法2,这样可以不用该数据库,也不用该c#代码 转自http://www.cnblogs.com/aeron/archive/2012/08/30/2663908.html
View Details介绍安装环境与版本 用两台虚拟机模拟6个节点,一台机器3个节点,创建出3 master、3 salve 环境。 redis 采用 redis-3.2.4 版本。 两台虚拟机都是 CentOS ,一台 CentOS6.5 (IP:192.168.31.245),一台 CentOS7(IP:192.168.31.210) 。 安装过程 1. 下载并解压 1 cd /root/software wget http://download.redis.io/releases/redis-3.2.4.tar.gz tar -zxvf redis-3.2.4.tar.gz 2. 编译安装 1 2 cd redis–3.2.4 make && make install 3. 将 redis-trib.rb 复制到 /usr/local/bin 目录下 1 2 cd src cp redis–trib.rb /usr/local/bin/ 4. 创建 Redis 节点 首先在 192.168.31.245 机器上 /root/software/redis-3.2.4 目录下创建 redis_cluster 目录; 1 mkdir redis_cluster 在 redis_cluster 目录下,创建名为7000、7001、7002的目录,并将 redis.conf 拷贝到这三个目录中 1 2 3 mkdir 7000 7001 7002<br>cp redis.conf redis_cluster/7000 cp redis.conf redis_cluster/7001 cp redis.conf redis_cluster/7002 分别修改这三个配置文件,修改如下内容 1 2 3 4 5 6 7 […]
View Details这篇文章主要介绍了超强、超详细Redis入门教程,本文详细介绍了Redis数据库各个方面的知识,需要的朋友可以参考下 1、【redis是什么】 redis是一个开源的、使用C语言编写的、支持网络交互的、可基于内存也可持久化的Key-Value数据库。 redis的官网地址,非常好记,是redis.io。(特意查了一下,域名后缀io属于国家域名,是british Indian Ocean territory,即英属印度洋领地) 目前,Vmware在资助着redis项目的开发和维护。 2、【redis的作者何许人也】 开门见山,先看照片: 是不是出乎了你的意料,嗯,高手总会有些地方与众不同的。 这位便是redis的作者,他叫Salvatore Sanfilippo,来自意大利的西西里岛,现在居住在卡塔尼亚。目前供职于Pivotal公司。 他使用的网名是antirez,如果你有兴趣,可以去他的博客逛逛,地址是antirez.com,当然也可以去follow他的github,地址是http://github.com/antirez。 3、【谁在使用redis】 Blizzard、digg、stackoverflow、github、flickr … 4、【学会安装redis】 Redis可以到官方网站:http://www.redis.io/download下载 Win版下载地址:https://github.com/dmajkic/redis/downloads 从redis.io下载最新版redis-X.Y.Z.tar.gz后解压 解压Redis的tar包很简单: tar -zxvf redis-x.y.z.tar.gz 这样就在当前目录下新建了一个包含发行版源代码的目录,必须cd进入这个目录以继续服务器的编译。 然后进入redis-X.Y.Z文件夹后直接make即可,安装非常简单。 如果make失败,可能是没装装GCC,使用yum install gcc进行安装后再make 如果报错:error: jemalloc/jemalloc.h: No such file or directory,则需要指定MALLOC,如:make MALLOC=libc,这在README 有这个说明,说关于分配器allocator, 如果有MALLOC 这个 环境变量, 会用这个环境变量去建立Redis。而libc 并不是默认的 分配器, 默认的是 jemalloc, 但是如果你没有jemalloc 而只有 libc 当然 make 出错。 所以加这么一个参数,make MALLOC=libc make成功后会在src文件夹下生成几个可执行文件,分别是redis-server、redis-cli、redis-benchmark、redis-check-aof、redis-check-dump等: 复制代码代码如下: $ find . -type f -executable ./redis-benchmark //用于进行redis性能测试的工具 ./redis-check-dump //用于修复出问题的dump.rdb文件 ./redis-cli //redis的客户端 ./redis-server //redis的服务端 ./redis-check-aof //用于修复出问题的AOF文件 ./redis-sentinel //用于集群管理 然后可以使用make install进行安装,会将redis的指令添加到环境变量中,可在任何目录调用 4、【学会启动redis】 启动redis非常简单,直接./redis-server就可以启动服务端了,还可以用下面的方法指定要加载的配置文件,不指定时会加载默认配置文件: 复制代码代码如下: ./redis-server ../redis.conf 默认情况下,redis-server会以非daemon的方式来运行,且默认服务端口为6379。有关作者为什么选择6379作为默认端口,还有一段有趣的典故,英语好的同学可以看看作者这篇博文中的解释。 有关于配置文件的配置说明,详见下文。 一般修改的是:IP,端口,访问密码,日志存放路径,数据库存放路径,日志级别这些 测试启动 redis-cli ping […]
View Details1、环境规划(我是在虚拟机环境下安装的) win03 192.168.2.57(管理节点,存储节点,sql节点) win03 192.168.2.56(存储节点,sql节点) 2、安装程序 在两台机器上面同时进行 第一步: 下载安装软件地址:https://edelivery.oracle.com/EPD/Search/handle_go 我的用的版本是MySQL Cluster 7.3.8 第二步: 管理节点安装时必须安装在c盘下,建议使用默认安装目录。如:C:\Program Files\MySQL\MySQL Cluster 7.3 非管理节点可安装在任意路径下 第三步: 安装mysql服务 在CMD命令行参数下: C:\Users\Administrator>cd C:\Program Files\MySQL\MySQL Cluster 7.3\bin C:\Program Files\MySQL\MySQL Cluster 7.3\bin>mysqld.exe --install mysql 第四步: 设置环境变量 3、创建管理节点配置文件 第一步: 创建config.ini文件,存放路径可任意存放 在c:\cluster\config.ini文件 内容为: [NDBD DEFAULT] NoOfReplicas=2 /*设置的节点个数*/ [NDB_MGMD] ID=1 hostname=192.168.2.57 datadir=c:\cluster\data #config storage nodeid [NDBD] ID=2 hostname=192.168.2.57 datadir=c:\cluster\ndbdata [NDBD] ID=3 hostname=192.168.2.56 datadir=C:\cluster\ndbdata #config SQL NODEID [MYSQLD] ID=4 hostname=192.168.2.57 [MYSQLD] ID=5 hostname=192.168.2.56 4、配置存储节点、SQL节点 第一步: 创建管理节点my.ini, 在安装路径下找一个my-default.ini文件,重命名为my.ini 如果将存储节点、SQL节点存放在同一台服务上,请在my.ini加入以下信息 建议在[mysqld]上方加入以下信息,此配置作用于存储节点挂载 [mysql_cluster] ndb-connectstring=192.168.2.57 在[mysqld]下加入,此配置作用于sql节点挂载 ndbcluster ndb-connectstring=192.168.2.57 #防止出现table is full错误 tmp_table_size = 1600M max_heap_table_size = 1600M […]
View Details技术准备:下载相关组件和文档,下载地址:http://pan.baidu.com/s/1mgVIL5Y 电脑:最好准备两台以上机器进行测试; mysql数据库配置: [client] port=3306 [mysql] #如果不是修改成UTF8 default-character-set=UTF8 [mysqld] port=3306 #Path to installation directory. All paths are usually resolved relative to this. basedir="C:/Program Files/MySQL/MySQL Server 5.5/" #Path to the database root datadir="C:/ProgramData/MySQL/MySQL Server 5.5/Data/" # The default character set that will be used when a new schema or table is #如果不是修改成UTF8 character-set-server=UTF8 # The default storage engine that will be used when create new tables when default-storage-engine=INNODB # Set the SQL mode to strict sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" # connection limit has been reached. max_connections=100 query_cache_size=0 table_cache=256 tmp_table_size=35M thread_cache_size=8 myisam_max_sort_file_size=100G myisam_sort_buffer_size=69M […]
View Details迁移IIS其实很简单,拿IIS7以上举例,只需把C:\Windows\System32\inetsrv\config\applicationHost.config复制到新服务器,文件目录要求相同的。
View Details|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
public void CheckServerState(string ServiceName) { ServiceController[] service = ServiceController.GetServices(); bool isStart = false; bool isExite = false; for (int i = 0; i < service.Length; i++) { if (service[i].ServiceName.ToUpper().Equals(ServiceName.ToUpper())) { isExite = true; server = service[i]; if (service[i].Status == ServiceControllerStatus.Running) { isStart = true; break; } } } if (!isExite) { this.label1.Text = ("不存在此服务"); }else{ if (isStart) { this.label1.Text = ("服务已经启动"); } else { this.label1.Text = ("服务没启动"); } } } |
from:http://www.cnblogs.com/lujin49/p/3527704.html
View Details|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
#region Windows服务控制区 #region 安装服务 /// <summary> /// 安装服务 /// </summary> private bool InstallService(string NameService) { bool flag = true; if (!IsServiceIsExisted(NameService)) { try { string location = System.Reflection.Assembly.GetExecutingAssembly().Location; string serviceFileName = location.Substring(0, location.LastIndexOf('\\') + 1) + NameService + ".exe"; InstallmyService(null, serviceFileName); } catch { flag = false; } } return flag; } #endregion #region 卸载服务 /// <summary> /// 卸载服务 /// </summary> private bool UninstallService(string NameService) { bool flag = true; if (IsServiceIsExisted(NameService)) { try { string location = System.Reflection.Assembly.GetExecutingAssembly().Location; string serviceFileName = location.Substring(0, location.LastIndexOf('\\') + 1) + NameService + ".exe"; UnInstallmyService(serviceFileName); } catch { flag = false; } } return flag; } #endregion #region 检查服务存在的存在性 /// <summary> /// 检查服务存在的存在性 /// </summary> /// <param name=" NameService ">服务名</param> /// <returns>存在返回 true,否则返回 false;</returns> public static bool IsServiceIsExisted(string NameService) { ServiceController[] services = ServiceController.GetServices(); foreach (ServiceController s in services) { if (s.ServiceName.ToLower() == NameService.ToLower()) { return true; } } return false; } #endregion #region 安装Windows服务 /// <summary> /// 安装Windows服务 /// </summary> /// <param name="stateSaver">集合</param> /// <param name="filepath">程序文件路径</param> public static void InstallmyService(IDictionary stateSaver, string filepath) { AssemblyInstaller AssemblyInstaller1 = new AssemblyInstaller(); AssemblyInstaller1.UseNewContext = true; AssemblyInstaller1.Path = filepath; AssemblyInstaller1.Install(stateSaver); AssemblyInstaller1.Commit(stateSaver); AssemblyInstaller1.Dispose(); } #endregion #region 卸载Windows服务 /// <summary> /// 卸载Windows服务 /// </summary> /// <param name="filepath">程序文件路径</param> public static void UnInstallmyService(string filepath) { AssemblyInstaller AssemblyInstaller1 = new AssemblyInstaller(); AssemblyInstaller1.UseNewContext = true; AssemblyInstaller1.Path = filepath; AssemblyInstaller1.Uninstall(null); AssemblyInstaller1.Dispose(); } #endregion #region 判断window服务是否启动 /// <summary> /// 判断某个Windows服务是否启动 /// </summary> /// <returns></returns> public static bool IsServiceStart(string serviceName) { ServiceController psc = new ServiceController(serviceName); bool bStartStatus = false; try { if (!psc.Status.Equals(ServiceControllerStatus.Stopped)) { bStartStatus = true; } return bStartStatus; } catch (Exception ex) { throw new Exception(ex.Message); } } #endregion #region 修改服务的启动项 /// <summary> /// 修改服务的启动项 2为自动,3为手动 /// </summary> /// <param name="startType"></param> /// <param name="serviceName"></param> /// <returns></returns> public static bool ChangeServiceStartType(int startType, string serviceName) { try { RegistryKey regist = Registry.LocalMachine; RegistryKey sysReg = regist.OpenSubKey("SYSTEM"); RegistryKey currentControlSet = sysReg.OpenSubKey("CurrentControlSet"); RegistryKey services = currentControlSet.OpenSubKey("Services"); RegistryKey servicesName = services.OpenSubKey(serviceName, true); servicesName.SetValue("Start", startType); } catch (Exception ex) { return false; } return true; } #endregion #region 启动服务 private bool StartService(string serviceName) { bool flag = true; if (IsServiceIsExisted(serviceName)) { System.ServiceProcess.ServiceController service = new System.ServiceProcess.ServiceController(serviceName); if (service.Status != System.ServiceProcess.ServiceControllerStatus.Running && service.Status != System.ServiceProcess.ServiceControllerStatus.StartPending) { service.Start(); for (int i = 0; i < 60; i++) { service.Refresh(); System.Threading.Thread.Sleep(1000); if (service.Status == System.ServiceProcess.ServiceControllerStatus.Running) { break; } if (i == 59) { flag = false; } } } } return flag; } #endregion #region 停止服务 private bool StopService(string serviceName) { bool flag = true; if (IsServiceIsExisted(serviceName)) { System.ServiceProcess.ServiceController service = new System.ServiceProcess.ServiceController(serviceName); if (service.Status == System.ServiceProcess.ServiceControllerStatus.Running) { service.Stop(); for (int i = 0; i < 60; i++) { service.Refresh(); System.Threading.Thread.Sleep(1000); if (service.Status == System.ServiceProcess.ServiceControllerStatus.Stopped) { break; } if (i == 59) { flag = false; } } } } return flag; } #endregion #endregion |
from:http://blog.csdn.net/smartsmile2012/article/details/8666635
View Details