Skip to content
Permalink
Browse files
Configuration for firewall-enabled windows images
  • Loading branch information
ygy committed Oct 9, 2015
1 parent ac27888 commit c6b526c4ccc54681ff2e8f1fdc21a428e81d9843
Showing 1 changed file with 30 additions and 30 deletions.
@@ -1,31 +1,31 @@
[#ftl]
#!ps1
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#netsh advfirewall firewall add rule name=MongoDB dir=in protocol=tcp action=allow localport=27017 remoteip=any profile=any
#( Get-WmiObject -Namespace "root\Microsoft\SqlServer\ComputerManagement11" -Query "Select * from ServerNetworkProtocolProperty where ProtocolName='Tcp' and IPAddressName='IPAll' and PropertyName='TcpPort'" ).SetStringValue("27017")

$ErrorActionPreference = "Stop"

New-Item c:\data\db -type directory -force
New-Item c:\data\log -type directory -force

set serviceName=MongoDB${config['mongodb.instance.name']}

[#ftl]
#!ps1
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

$ErrorActionPreference = "Stop"

netsh advfirewall firewall add rule name=MongoDB dir=in protocol=tcp action=allow localport=27017 remoteip=any profile=any

New-Item c:\data\db -type directory -force
New-Item c:\data\log -type directory -force

set serviceName=MongoDB${config['mongodb.instance.name']}

& 'C:\Program Files\MongoDB\Server\3.0\bin\mongod' '--rest' '--dbpath=C:\data\db' '--logpath=c:\data\log\service.log' '--install' '--serviceName=MongoDB${config['mongodb.instance.name']}' '--serviceDisplayName=MongoDB${config['mongodb.instance.name']}'

0 comments on commit c6b526c

Please sign in to comment.