add how to config fqdn in readme-win.md

This commit is contained in:
zyyang 2020-10-28 09:59:29 +08:00
parent f19f5e4643
commit 0ddaaa3e01
1 changed files with 34 additions and 14 deletions

View File

@ -1,20 +1,11 @@
# 如何在windows上使用nodejs进行TDengine应用开发
## 环境准备
1安装nodejs-10.22.0
下载链接https://nodejs.org/dist/v10.22.0/node-v10.22.0-win-x64.zip
解压安装:
![image-20201027160836957](C:\Users\Gemini\AppData\Roaming\Typora\typora-user-images\image-20201027160836957.png)
把node配置到环境变量里
![image-20201027161258158](C:\Users\Gemini\AppData\Roaming\Typora\typora-user-images\image-20201027161258158.png)
解压安装把node配置到环境变量里
cmd启动命令行查看node的版本
@ -40,7 +31,6 @@ Python 2.7.18
```
3安装TDengine-client
下载地址https://www.taosdata.com/cn/all-downloads/选择一个合适的windows-client下载client应该尽量与server端的版本保持一致
@ -61,12 +51,10 @@ Query OK, 1 row(s) in set (0.036000s)
```
注意:
* 检查能否在client的机器上ping通server的fqdn
* 如果你的dns server并没有提供到server的域名解析可以将server的hostname配置到client的hosts文件中
## 应用开发
1建立nodejs项目
@ -152,7 +140,7 @@ function printSql(sql, succeed, cost) {
Usage: node nodejsChecker.js host=<hostname> port=<port>
# 提示指定host
>node nodejsChecker.js host=192.168.1.59
>node nodejsChecker.js host=node5
Successfully connected to TDengine
Query OK, 0 row(s) affected (0.00997610s)
[ OK ] time cost: 14 ms, execute statement ====> create database if not exists testnodejs
@ -173,3 +161,35 @@ Connection is closed
2020-10-27 18:49:15.547 | 20.5 | 34 |
```
## 指南
### 如何设置主机名和hosts
在server上查看hostname和fqdn
```shell
查看hostname
# hostname
taos-server
查看fqdn
# hostname -f
taos-server
```
windows下hosts文件位于
C:\\Windows\System32\drivers\etc\hosts
修改hosts文件添加server的ip和hostname
```
192.168.56.101 node5
```
> 什么是FQDN
>
> FQDNFull qualified domain name全限定域名fqdn由2部分组成hostname+domainname。
>
> 例如一个邮件服务器的fqdn可能是mymail.somecollege.edu其中mymail是hostname主机名somcollege.edu是domainname域名。本例中.edu是顶级域名.somecollege是二级域名。
>
> 当连接服务器时必须指定fqdn然后dns服务器通过查看dns表将hostname解析为相应的ip地址。如果只指定hostname不指定domainname应用程序可能服务解析主机名。因为如果你试图访问不在本地的远程服务器时本地的dns服务器和可能没有远程服务器的hostname列表。
>
> 参考https://kb.iu.edu/d/aiuv