在 mongos 中添加分片 sh.addShard 时意外的令牌非法
Unexpected Token ILLEGAL while adding shard sh.addShard in mongos
我正在经历这个 post https://www.digitalocean.com/community/tutorials/how-to-create-a-sharded-cluster-in-mongodb-using-an-ubuntu-12-04-vps
我有 3 个配置、2 个查询和 4 个分片
我能够成功地通过 ssh 登录到每个 droplet
但是在"Add Shards to the cluster"部分
每当我做
sh.addShard( "shard-01.my-domain.com:27017” )
它给了我
2017-01-19T14:10:10.487+0000 SyntaxError: Unexpected token ILLEGAL
即使我用 ip
sh.addShard( "xxx.59.39.62:27017” )
它给了我
2017-01-19T14:10:10.487+0000 SyntaxError: Unexpected token ILLEGAL
我做错了什么吗?语法类似于 link 和任何地方
中描述的语法
'xxx只是为了隐藏IP
您使用的是弯引号而不是普通引号:
"shard-01.my-domain.com:27017”
这样做:
"shard-01.my-domain.com:27017"
有些文本编辑器有时会这样做。
我正在经历这个 post https://www.digitalocean.com/community/tutorials/how-to-create-a-sharded-cluster-in-mongodb-using-an-ubuntu-12-04-vps
我有 3 个配置、2 个查询和 4 个分片 我能够成功地通过 ssh 登录到每个 droplet
但是在"Add Shards to the cluster"部分
每当我做
sh.addShard( "shard-01.my-domain.com:27017” )
它给了我
2017-01-19T14:10:10.487+0000 SyntaxError: Unexpected token ILLEGAL
即使我用 ip
sh.addShard( "xxx.59.39.62:27017” )
它给了我
2017-01-19T14:10:10.487+0000 SyntaxError: Unexpected token ILLEGAL
我做错了什么吗?语法类似于 link 和任何地方
中描述的语法'xxx只是为了隐藏IP
您使用的是弯引号而不是普通引号:
"shard-01.my-domain.com:27017”
这样做:
"shard-01.my-domain.com:27017"
有些文本编辑器有时会这样做。