npm源 由于 verdaccio 默认使用的是npm官方的源,你可以改成淘宝的源 他的配置文件在 /home/<username>/.config/verdaccio/config.yaml 其中有个 uplinks 字段 uplinks: npmjs: url: https://registry.npmjs.org/ 将 url 改为 https://registry.npm.taobao.org
主要配置uplinks来实现. ? uplinks: npmjs: url: https://registry.npmjs.org/ timeout: 10s yarn: url: https://registry.yarnpkg.com / timeout: 10s taobao: url: https://registry.npm.taobao.org/ timeout: 10s Verdaccio Uplinks 而非npm那样只打deprecated标记位 proxy: nexus-yunshu # 这里就是关联上游链了,uplinks,支持多个上游链 '**': # 最终索引的地方,是不是很像路由的概念
/htpasswd max_users: 1000 #默认为1000,改为-1,禁止注册 代理配置 在uplinks里设置源,然后在packages里设置proxy # a list of other known repositories we can talk to uplinks: taobao: url: https://registry.npm.taobao.org/ # max_users: 1000 # a list of other known repositories we can talk to uplinks: taobao: url
max_users: -1 #默认为1000,改为-1,禁止注册 # a list of other known repositories we can talk to uplinks: npmjs package is not available locally, proxy requests to 'npmjs' registry proxy: npmjs #如其名,这里的值是对应于 uplinks
# 本地不存在时,读取仓库的地址 uplinks: npmjs: url: https://registry.npmjs.org/ yarn: registry.yarnpkg.com/ # 对包的访问操作权限,可以匹配某个具体项目,也可以通配 # access 访问下载;publish 发布;unpublish 取消发布; # proxy 对应着uplinks
verdaccio verdaccio 是一个开源轻量的 npm 私服 全局安装: $ npm install verdaccio -g 配置 ~/.config/verdaccio/config.yaml uplinks : --- # a list of other known repositories we can talk to uplinks: npmjs: url: https://registry.npmjs.org
config 文件夹新建该文件,填入以下内容: storage: /verdaccio/storage auth: htpasswd: file: /verdaccio/conf/htpasswd uplinks proxy: npmjs logs: - {type: stdout, format: pretty, level: http} htpasswd 文件是用来存储 npm 用户及密码信息的文件 uplinks
config.yaml 最后一行添加 listen: 192.168.227.129:4873 保证共享访问 # a list of other known repositories we can talk to uplinks
sort_packages: asc auth: # max_users: 1000 # a list of other known repositories we can talk to uplinks uplinks 也许,我们的包不止发布到了一个仓库,如果公司按照业务线划分了几个前端部门,部门之间技术独立但能共享,这时如果我们想在使用自己发布的npm私有包的同时,还期望可以使用其他团队开发的npm包 配置如下,在这里其实只是做一个定义,真正的使用其实是在包 packages 管理的参数中 uplinks: npmjs: url: https://registry.npmjs.org
做法也是修改这个配置文件,找到uplinks下面两行把url替换一下,具体的如下: # a list of other known repositories we can talk to uplinks
#max_users: 1000 # a list of other known repositories we can talk to uplinks: npmjs: url: https
your-company-cert hosts: - npm.your-company.com configMap 配置 #....other # 使用淘宝的cnpmjs镜像,加速 uplinks
而这些设备互联时,则需使用交叉线: 1.交换机与交换机之间通过UPLINKS口连接; 2.HUB与交换机连接; 3.HUB与HUB之间连接; 4.两台PC直接相连;
# rounds: 10 # https://verdaccio.org/docs/configuration#uplinks # 可以连接的其他已知仓库列表 uplinks: npmjs: /htpasswd # https://verdaccio.org/docs/configuration#uplinks # 可以连接的其他已知仓库列表 uplinks: npmmirror:
1000 # a list of other known repositories we can talk to #上游配置本地没有的资源去上游拉取,可以配置淘宝镜像,由于镜像本身问题建议使用源 uplinks
htpasswd # htpasswd 文件为加密认证信息文件 max_users: -1 # 最大用户数量, -1 表示禁用新用户注册 # 上行链路 uplinks htpasswd # htpasswd 文件为加密认证信息文件 max_users: -1 # 最大用户数量, -1 表示禁用新用户注册 # 上行链路 uplinks
3 network with a /24 subnet, which # could be typical where each rack has its own # switch with uplinks
item) { const i = this.indexOf(item); if (i < 0) return false; else return this.splice(i, 1); }; Uplinks
每台叶交换机使用一定数量的端口作为上行链路(Uplinks),连接到2台脊交换机。确保上行链路的总带宽不低于所有下行链路(连接节点)的总带宽,以实现“非阻塞”。
$ esxcfg-vswitch -l # Switch Name Num Ports Used Ports Configured Ports MTU Uplinks # vSwitch0 13 128 1500 vmnic0 # PortGroup Name VLAN ID Used Ports Uplinks