Zookeeper客户端zkCli使用说明

连接Zookeeper服务端

命令:bin/zkCli.sh -server localhost:2181

如下所示,即表示连接成功!

[root@node04 bin]# zkCli.sh
Connecting to localhost:2181
...
[zk: localhost:2181(CONNECTED) 0]
[root@node04 bin]# zkCli.sh -server localhost:2181
Connecting to localhost:2181
...
[zk: localhost:2181(CONNECTED) 0]

This application requires Visual Studio 2019 x64 Redistributable解决办法

问题场景:安装MySQL或mysql-connector时提示:
This application requires Visual Studio 2019 Redistributable. Please install the Redistributable then run this installer again.

问题原因:缺少C++环境

解决办法:安装Microsoft Visual C++ 2015-2022 Redistributable(x64)

官方下载地址:
https://learn.microsoft.com/zh-CN/cpp/windows/latest-supported-vc-redist?view=msvc-170

根据提示版本及操作系统类型下载:
vc_redist.x64.exe
vc_redist.x86.exe
双击安装即可。

Axios如何实现同步请求(async与await)

Axios介绍

Axios是一个基于promise的网络请求库,可以用在浏览器和 node.js中。

Axios本质上也是对原生XHR的封装,只不过它是Promise的实现版本。

主要特点:
从浏览器创建 XMLHttpRequests
从 node.js 创建 http 请求
支持 Promise API
拦截请求和响应
转换请求和响应数据
取消请求
自动转换JSON数据
客户端支持防御XSRF

在axios中,所有的请求都是异步发送的。所以单独用axios是实现不了同步的,需要结合async与await关键字使用。