鼎鼎知识库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2020诺德局域网上云.md 16KB

4 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. # 查看和准备当前数据库
  2. - 已经有数据库:lq_nuode
  3. - 准备创建数据库:rlq_nuode
  4. # 云端添加项目数据库
  5. - DD.Electricity.Cloud.PrPersistence
  6. - appsettings.json中,添加相关
  7. - GlobalSettings中,添加相关
  8. - DesignTimeDbContextFactoryBase中,添加相关
  9. - 右键DD.Electricity.Cloud.PrPersistence,生成项目
  10. - dotnet ef datbase update -c ProjectDbContext, 这样云端数据就多了`rlq_nuode`这个数据库
  11. # 更新源代码Web层
  12. - DD.Electricity.Cloud.WebUI
  13. - appsettings.json中,添加相关
  14. - GlobalSettings.json中,添加相关
  15. - Program.cs中,添加相关
  16. - 右键DD.Electricity.Cloud.WebUI,发布网站
  17. - 更新云端网站
  18. # 权限管理后台添加集团、项目以及项目用户
  19. - DD.Electricity.Cloud.AuthServer
  20. - 管理员登录:13800000000 DrrnFwd2018
  21. - 添加集团:青岛利群集团,记录主键是7
  22. - 添加项目:青岛诺德购物广场,记录主键将是9
  23. ```
  24. 项目名称:青岛诺德购物广场
  25. 集团:青岛利群集团
  26. ip:47.103.61.198
  27. 端口号:3306
  28. 数据库名称:rlq_nuode
  29. 连接字符串:rlq_nuode
  30. Sort:1
  31. 时序数据库API地址:http://47.102.145.164:6020/rest/sql
  32. 时序数据库用户名:root
  33. 时序数据库密码:taosdata
  34. 时序数据库名称:rlq_nuode_7_9
  35. ```
  36. - 在rlq_nuode数据库中,把type设置成0
  37. - 查看鼎鼎展厅1的用户名和角色
  38. ```
  39. 用户名:ddzt1
  40. 密码:888888
  41. 角色:DianGong
  42. ```
  43. - 添加诺德用户:nuode 888888
  44. ```
  45. 用户名:nuode
  46. 密码:888888
  47. 集团:青岛利群集团
  48. 项目:青岛诺德购物广场
  49. 角色:DianGong
  50. ```
  51. # 确认时序数据库所在的Linux服务器状态
  52. - 使用PuTTY连接Linux服务器
  53. - 检查状态:systemctl status taosd
  54. - 启动服务:systemctl start taosd
  55. - 修改配置文件:cd /etc/taos/ vim taos.cfg
  56. # Windows客户端连接时序数据库
  57. - 客户端连接TDengine: ./taos.exe -h 47.102.145.164
  58. - 展示所有数据库:show databases;
  59. - 创建数据库:create database rlq_nuode_7_9;
  60. - 使用某个数据库:use database rlq_nuode_7_9;
  61. # 准备网站环境
  62. - 确认局域网网站SDK版本:netcoreapp3.0
  63. - sdk已经存在:dotnet-hosting-3.0.0-win
  64. # 旧版本更换模块
  65. > 14E38更换成14784
  66. - 确认缓存中是否有14784的数据
  67. - 记录当前的开关编号,1015-1024
  68. - 删除相关
  69. ```
  70. -- KaiGuan
  71. 编号:1015-1024
  72. Mac:187ed5314e38
  73. 地址:1-10
  74. -- SceneItem
  75. select * from sceneitem where KaiGuanId in ('1015','1016','1017','1018','1019','1020','1021','1022','1023','1024')
  76. -- SceneDetails
  77. select * from scenedetails limit 1
  78. select * from scenedetails where mac='187ed5314e38'
  79. -- warninghistories
  80. select * from warninghistories where KaiGuanId in ('1015','1016','1017','1018','1019','1020','1021','1022','1023','1024')
  81. -- kaiguanwarning
  82. select * from kaiguanwarning where KaiGuanId in ('1015','1016','1017','1018','1019','1020','1021','1022','1023','1024')
  83. -- 删除
  84. delete from scenedetails where mac='187ed5314e38'
  85. delete from sceneitem where KaiGuanId in ('1015','1016','1017','1018','1019','1020','1021','1022','1023','1024')
  86. delete from warninghistories where KaiGuanId in ('1015','1016','1017','1018','1019','1020','1021','1022','1023','1024')
  87. delete from kaiguanwarning where KaiGuanId in ('1015','1016','1017','1018','1019','1020','1021','1022','1023','1024')
  88. delete from kaiguan where Mac='187ed5314e38'
  89. ```
  90. - 添加新开关
  91. ```
  92. select * from kaiguan where Mac='187ed5314c38' sort=3
  93. select * from kaiguan where Mac='187ed5314d98' sort=1
  94. 187ed5314784 sort=2
  95. select * from kaiguan where Mac='187ed5314784'
  96. ```
  97. - 可视化界面-1层F区,尝试是否可以分断合闸
  98. - 添加到场景中
  99. ```
  100. -- -1层F区9点关
  101. -- -1层F区下班关
  102. -- -1层F区上班开
  103. ```
  104. # 14B84换成1EFAO
  105. - 模块默认IP:192.168.91.1:82
  106. - 服务器指向:`192.168.0.252:8080/ebx-bishop/data/carry`
  107. - 其它
  108. ```
  109. -- KaiGuan
  110. Mac:187ed5314b84
  111. 15个开关,编号1-15
  112. Sort:3
  113. 1-5 梯东,6 廊灯,7 梯底,8和9 服务台,10 灯箱,11电视,12-15空
  114. --场景
  115. -1A区晚上21点关:线路10
  116. -1层A区上班开:1-15
  117. -1层A区下班关:1-15
  118. -- SceneItem
  119. select * from sceneitem where KaiGuanId in ('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15')
  120. -- SceneDetails
  121. select * from scenedetails where mac='187ed5314b84'
  122. -- warninghistories
  123. select * from warninghistories where KaiGuanId in ('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15')
  124. -- kaiguanwarning
  125. select * from kaiguanwarning where KaiGuanId in ('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15')
  126. -- 删除
  127. delete from scenedetails where mac='187ed5314b84'
  128. delete from sceneitem where KaiGuanId in ('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15')
  129. delete from warninghistories where KaiGuanId in ('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15')
  130. delete from kaiguanwarning where KaiGuanId in ('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15')
  131. delete from kaiguan where Mac='187ed5314b84'
  132. --添加新开关
  133. 用户名:13800000000
  134. 密码:DrrnFwd2018
  135. select Id, Mac, LineAddress, Name from kaiguan where Mac='187ed531efa0'
  136. update kaiguan set Name='梯东' where Mac='187ed531efa0' and LineAddress in ('1','2','3','4','5')
  137. update kaiguan set Name='廊灯' where Mac='187ed531efa0' and LineAddress='6'
  138. update kaiguan set Name='梯底' where Mac='187ed531efa0' and LineAddress='7'
  139. update kaiguan set Name='服务台' where Mac='187ed531efa0' and LineAddress in ('8','9')
  140. update kaiguan set Name='灯箱' where Mac='187ed531efa0' and LineAddress='10'
  141. update kaiguan set Name='电视' where Mac='187ed531efa0' and LineAddress='11'
  142. update kaiguan set Name='空' where Mac='187ed531efa0' and LineAddress in ('12','13','14','15')
  143. 补Code
  144. ```
  145. - 可视化界面-1层A区,尝试是否可以分断合闸
  146. - 添加到场景中
  147. ```
  148. --场景
  149. -1A区晚上21点关:线路10 187ed531efa0
  150. -1层A区上班开:1-15
  151. -1层A区下班关:1-15
  152. ```
  153. - 14B84从缓存中删除
  154. - 处理云端
  155. ```
  156. # 1571C换成226AC
  157. - 模块默认IP:192.168.91.1:82
  158. - 服务器指向:`192.168.0.252:8080//ebx-bishop/data/carry`
  159. - 其它
  160. ```
  161. -- KaiGuan
  162. Mac:187ed531571c
  163. select * from kaiguan where Mac='187ed531571c'
  164. 7个开关,编号870-876
  165. Sort:9
  166. 1 走廊吊灯
  167. 2 电梯前室
  168. 3 扶梯上反灯
  169. 4 -5 楼梯反光
  170. 6 电视墙
  171. 7 电梯走廊
  172. --场景
  173. -4层晚上19点关 21:27触发,4,5,6
  174. -4层下班关 22:30 1,3,6
  175. -4层货梯下班关 21:50 2,7
  176. -- SceneItem
  177. select * from sceneitem where KaiGuanId in ('870','871','872','873','874','875','876')
  178. -- SceneDetails
  179. select * from scenedetails where mac='187ed531571c'
  180. -- warninghistories
  181. select * from warninghistories where KaiGuanId in ('870','871','872','873','874','875','876')
  182. -- kaiguanwarning
  183. select * from kaiguanwarning where KaiGuanId in ('870','871','872','873','874','875','876')
  184. -- 删除
  185. delete from scenedetails where mac='187ed531571c'
  186. delete from sceneitem where KaiGuanId in ('870','871','872','873','874','875','876')
  187. delete from warninghistories where KaiGuanId in ('870','871','872','873','874','875','876')
  188. delete from kaiguanwarning where KaiGuanId in ('870','871','872','873','874','875','876')
  189. delete from kaiguan where Mac='187ed531571c'
  190. -- 删除缓存中的模块
  191. --添加新开关
  192. 用户名:13800000000
  193. 密码:DrrnFwd2018
  194. -- 设置开关名称
  195. -- 补Code
  196. ```
  197. select Mac, LineAddress, Name, Code from kaiguan where Mac='187ed53226ac'
  198. update kaiguan set Name='走廊吊灯',Code='1' where Mac='187ed53226ac' and LineAddress=1
  199. update kaiguan set Name='电梯前室',Code='2' where Mac='187ed53226ac' and LineAddress=2
  200. update kaiguan set Name='扶梯上反灯',Code='3' where Mac='187ed53226ac' and LineAddress=3
  201. update kaiguan set Name='楼梯反光',Code='4' where Mac='187ed53226ac' and LineAddress=4
  202. update kaiguan set Name='楼梯反光',Code='5' where Mac='187ed53226ac' and LineAddress=5
  203. update kaiguan set Name='电视墙',Code='6' where Mac='187ed53226ac' and LineAddress=6
  204. update kaiguan set Name='电梯走廊',Code='7' where Mac='187ed53226ac' and LineAddress=7
  205. ```
  206. -- 设置场景
  207. ```
  208. - 可视化界面4层A区,尝试是否可以分断合闸
  209. - 添加到场景中
  210. - 同步时序数据库
  211. - 处理云端
  212. ```
  213. # 连接局域网服务器
  214. - 网址:192.168.0.252,TecheFwd123
  215. - 当前版本所在文件夹:D:\websites\dingding_v1.1.5.2_us
  216. - 服务器信息
  217. ```
  218. 处理器:intel 3.3GHZ 4核
  219. 内存:8GB
  220. 系统类型:64位
  221. Windows版本:Windows Server 2012 R2 Standard
  222. ```
  223. # 部署网站
  224. - 创建新文件夹:2020_v1.0.0.0
  225. - Home/Index修改24小时负荷的stepSize
  226. - 禁用每30秒一次的RealDataToCloud
  227. - 禁用每分钟一次的RealDataToTDengine
  228. - 禁用每小时一次的TongJiByHourTDengine
  229. - 发布网站,把网站拷贝到2020_v1.0.0.0文件夹
  230. - 安装netcoreapp3.0运行时
  231. - 修改appsettings.json
  232. ```
  233. 云端数据库:rlq_nuode
  234. 本地网址:192.168.0.252
  235. groupid:7
  236. projectid:9
  237. connkey:rlq_nuode
  238. 时序数据库名称:rlq_nuode_7_9
  239. ```
  240. - 运行:dotnet.exe DD.Local.Web.dll
  241. - 管理员身份登录:13800000000,DrrnFwd2018(TecheFwd2018)
  242. # 把局域网位置和场景同步到云端
  243. - 同步位置
  244. - 同步场景
  245. - 超级表
  246. - 子表
  247. - 启用每30秒一次的RealDataToCloud
  248. - 启用每分钟一次的RealDataToTDengine
  249. - 启用每小时一次的TongJiByHourTDengine
  250. - 重新生成网站
  251. - 发现各项都慢
  252. ```
  253. -- 服务器支持的最大连接数,最大连接数,默认100,一般经验设置3000。win服务器连接数支持1500-1800。
  254. show variables like '%max_connections%';
  255. set global max_connections=1000
  256. -- 响应的最大连接数,检查曾经使用最大的连接数,这个值在max_connections的85%左右比较合适,过高,则会系统使用连接数过少,系统负荷过高。Max_used_connections / max_connections * 100%=44/151,最好是占85%以上。
  257. show global status like 'max_used_connections'
  258. -- max_user_connections=0,表示不限制用户的最大连接数,其最大值可以等于max_connections
  259. show variables like '%max_user_connections';
  260. -- show status like 'Threads%';
  261. 参数说明:
  262. Threads_cached 34 ##mysql管理的线程池中还有多少可以被复用的资源
  263. Threads_connected 32 ##打开的连接数
  264. Threads_created 66 ##代表新创建的thread(根据官方文档,如果thread_created增大迅速,需要适当调高 thread_cache_size)。
  265. Threads_running 2 ##激活的连接数,这个数值一般远低于connected数值,准确的来说,Threads_running是代表当前并发数
  266. sql> show variables like 'thread_cache_size';
  267. sql> set global thread_cache_size=60;
  268. ```
  269. select * from real_187ed5314b84 where ts >= NOW - 1h;
  270. # 在局域网创建时序数据库表
  271. - 超级表
  272. ```
  273. - superreal
  274. - superrealtj
  275. - superwarning
  276. - superwarningtj
  277. - superdl
  278. ```
  279. - 子表
  280. ```
  281. - real_187ed5314e0c;
  282. - realtj_187ed5314e0c_h; realtj_187ed5314e0c_d; realtj_187ed5314e0c_n;realtj_187ed5314e0c_y;
  283. - warning_187ed5314e0c;
  284. - warningtj_187ed5314e0c_h; warningtj_187ed5314e0c_d; warningtj_187ed5314e0c_n;warningtj_187ed5314e0c_y;
  285. - dl_187ed5314e0c
  286. ```
  287. - 云端同步
  288. # 2020年10月7日 换模块
  289. ```
  290. 192.168.18.38
  291. TecheFwd123
  292. 192.168.0.215
  293. http://192.168.0.1/ admin admin
  294. LAN设置 客户端列表
  295. 192.168.0.252:8080/ebx-bishop/data/carry
  296. -- 粮油区第6排和第5排
  297. -- 15034换成2F658 192.168.0.141 第5排
  298. -- 16484换成2CB7C 192.168.0.71 第6排
  299. select * from kaiguan where Mac='187ed5316484' ip 192.168.0.64 不对
  300. 新模块:
  301. # 15034换成2F658
  302. -局域网找新模块确认指向?已确认。
  303. -新模块是否最新?确实最新。最新。
  304. -确认旧模块是否不再更新?最后一次更新时间在2020-10-06 09:34:19,确实不再更新。
  305. -记录旧模块的开关编号和开关名称?
  306. select * from KaiGuan where Mac='187ed5315034'
  307. in ('260','261','262','263','264','265','266','267','268','269', '270','271','272','273','274','275')
  308. -记录旧模块的场景
  309. -1D区晚上21点关 2,4,6,8,10,14
  310. -1层D区下班关 1,3,5,7,9,11,12,13,16
  311. -1层收银下班 14,15
  312. -1层D区上班开 2,4,5,6,8,10,11,12,13,14,15,16
  313. -1层E区上班早开 1,3,7,9
  314. 粮油调味区盘点关 1-10
  315. 粮油调味区盘点开 1-10
  316. -删除旧模块SceneDetails
  317. select * from sceneDetails where mac='187ed5315034'
  318. delete from sceneDetails where mac='187ed5315034'
  319. -删除旧模块SceneItem
  320. select * from SceneItem where KaiGuanId in ('260','261','262','263','264','265','266','267','268','269', '270','271','272','273','274','275')
  321. delete from SceneItem where KaiGuanId in ('260','261','262','263','264','265','266','267','268','269', '270','271','272','273','274','275')
  322. -删除旧模块warninghistories
  323. select * from warningHistories where KaiGuanId in ('260','261','262','263','264','265','266','267','268','269', '270','271','272','273','274','275')
  324. delete from warningHistories where KaiGuanId in ('260','261','262','263','264','265','266','267','268','269', '270','271','272','273','274','275')
  325. -删除旧模块kaiguanwarning
  326. select * from kaiguanwarning where KaiGuanId in ('260','261','262','263','264','265','266','267','268','269', '270','271','272','273','274','275')
  327. delete from KaiGuanWarning where KaiGuanId in ('260','261','262','263','264','265','266','267','268','269', '270','271','272','273','274','275')
  328. -删除旧模块开关
  329. select * from KaiGuan where Mac='187ed5315034'
  330. delete from KaiGuan where Mac='187ed5315034'
  331. -删除缓存
  332. AllMac
  333. 其它相关缓存
  334. -添加新模块开关
  335. select Mac, LineAddress, Name from KaiGuan where Mac='187ed5328658'
  336. update KaiGuan Set Name='射灯2' where Mac='187ed5328658' and LineAddress='1';
  337. update KaiGuan Set Name='灯带9' where Mac='187ed5328658' and LineAddress='2';
  338. update KaiGuan Set Name='灯带10' where Mac='187ed5328658' and LineAddress='3';
  339. update KaiGuan Set Name='灯带10' where Mac='187ed5328658' and LineAddress='4';
  340. update KaiGuan Set Name='灯带11' where Mac='187ed5328658' and LineAddress='5';
  341. update KaiGuan Set Name='灯带11' where Mac='187ed5328658' and LineAddress='6';
  342. update KaiGuan Set Name='灯带12' where Mac='187ed5328658' and LineAddress='7';
  343. update KaiGuan Set Name='灯带12' where Mac='187ed5328658' and LineAddress='8';
  344. update KaiGuan Set Name='灯带14' where Mac='187ed5328658' and LineAddress='9';
  345. -设置新模块相关场景
  346. S3上班
  347. S3下班
  348. #16484换成2CB7C
  349. -局域网找新模块确认指向?
  350. -新模块是否最新?确实最新。
  351. -确认旧模块是否不再更新?最后一次更新时间在2020-10-06 09:34:19,确实不再更新。
  352. -记录旧模块的开关编号和开关名称?
  353. select * from KaiGuan where Mac='187ed5316484'
  354. in ('276','277','278','279','280','281','282')
  355. -记录旧模块的场景
  356. -1D区晚上21点关 1
  357. -1层D区下班关 2,3,4,5,6,7
  358. -1层收银下班 5
  359. -1层D区上班开 1-7
  360. -删除旧模块SceneDetails
  361. select * from sceneDetails where mac='187ed5316484'
  362. delete from sceneDetails where mac='187ed5316484'
  363. -删除旧模块SceneItem
  364. select * from SceneItem where KaiGuanId in ('276','277','278','279','280','281','282')
  365. delete from SceneItem where KaiGuanId in ('276','277','278','279','280','281','282')
  366. -删除旧模块warninghistories
  367. select * from warningHistories where KaiGuanId in ('276','277','278','279','280','281','282')
  368. delete from warningHistories where KaiGuanId in ('276','277','278','279','280','281','282')
  369. -删除旧模块kaiguanwarning
  370. select * from kaiguanwarning where KaiGuanId in ('276','277','278','279','280','281','282')
  371. delete from KaiGuanWarning where KaiGuanId in ('276','277','278','279','280','281','282')
  372. -删除旧模块开关
  373. select * from KaiGuan where Mac='187ed5316484'
  374. delete from KaiGuan where Mac='187ed5316484'
  375. -删除缓存
  376. AllMac
  377. 其它相关缓存
  378. -添加新模块开关
  379. select Mac, LineAddress, Name from KaiGuan where Mac='187ed5328658'
  380. update KaiGuan Set Name='射灯2' where Mac='187ed5328658' and LineAddress='1';
  381. update KaiGuan Set Name='灯带9' where Mac='187ed5328658' and LineAddress='2';
  382. update KaiGuan Set Name='灯带10' where Mac='187ed5328658' and LineAddress='3';
  383. update KaiGuan Set Name='灯带10' where Mac='187ed5328658' and LineAddress='4';
  384. update KaiGuan Set Name='灯带11' where Mac='187ed5328658' and LineAddress='5';
  385. update KaiGuan Set Name='灯带11' where Mac='187ed5328658' and LineAddress='6';
  386. update KaiGuan Set Name='灯带12' where Mac='187ed5328658' and LineAddress='7';
  387. update KaiGuan Set Name='灯带12' where Mac='187ed5328658' and LineAddress='8';
  388. update KaiGuan Set Name='灯带14' where Mac='187ed5328658' and LineAddress='9';
  389. -设置新模块相关场景
  390. S3上班
  391. S3下班
  392. ```