![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
|
|
#1
|
|||
|
|||
|
a eso casimiro notevi. es por que buscano con que instalador lo hicieron encontre que la toman como gran empresa.
bueno para micaso. el instalador no funciona como el innosetup. y a mi desesperacion.. de que no instala el postgresql. una duda. buscando en el codigo de instalacion hay un vbscript que se encarga de la inicializacion del cluster de base de datos usando un programa initdb el codigo llama asi. [/code] ' Check the command line If WScript.Arguments.Count <> 11 Then Wscript.Echo "Usage: initcluster.vbs <OSUsername> <SuperUsername> <Password> <Install dir> <Data dir> <xlog dir> <Port> <Locale> <Mode> <server_utilization> <workload_profile>" Wscript.Quit 127 End If [/code] y en el log de instalacion se llama a ese vb con los parametros Código:
Executing cscript //NoLogo "C:\PostgresPlus\8.4AS\installer\server/initcluster.vbs" "enterprisedb" "enterprisedb" "****" "C:\PostgresPlus\8.4AS" "C:\PostgresPlusData" "C:\PostgresPlusData\pg_xlog" 5444 "DEFAULT" "oracle" "66" "oltp"cd <OSUsername> <SuperUsername> <Password> "enterprisedb" "enterprisedb" "****" ¿saben que contraseña tiene el usuario enterprisedb ? por que ahi lo enmascaran y lo crea el instalador. Código:
On Error Resume Next
' Postgres Plus Advanced Server server cluster init script for Windows
' Dave Page, EnterpriseDB
Const ForReading = 1
Const ForWriting = 2
' Check the command line
If WScript.Arguments.Count <> 11 Then
Wscript.Echo "Usage: initcluster.vbs <OSUsername> <SuperUsername> <Password> <Install dir> <Data dir> <xlog dir> <Port> <Locale> <Mode> <server_utilization> <workload_profile>"
Wscript.Quit 127
End If
strOSUsername = WScript.Arguments.Item(0)
strUsername = WScript.Arguments.Item(1)
strPassword = WScript.Arguments.Item(2)
strInstallDir = WScript.Arguments.Item(3)
strDataDir = WScript.Arguments.Item(4)
strXlogDir = WScript.Arguments.Item(5)
lPort = CLng(WScript.Arguments.Item(6))
strLocale = WScript.Arguments.Item(7)
strDatabaseMode = WScript.Arguments.Item(8)
strServerUtilization = WScript.Arguments.Item(9)
strWorkLoadProfile = WScript.Arguments.Item(10)
strMode=" "
'set database mode to --no-redwood-compat if mode is postgresql
If strDatabaseMode = "postgresql" Then
strMode = "--no-redwood-compat"
End If
' Remove any trailing \'s from the data dir - they will confuse cacls
If Right(strDataDir, 1) = "\" Then
strDataDir = Left(strDataDir, Len(strDataDir)-1)
End IF
' Remove any trailing \'s from the xlog dir - they will confuse cacls
If Right(strXlogDir, 1) = "\" Then
strXlogDir = Left(strXlogDir, Len(strXlogDir)-1)
End IF
Dim strInitdbPass
iWarn = 0
' Get temporary filenames
Set objShell = WScript.CreateObject("WScript.Shell")
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objTempFolder = objFso.GetSpecialFolder(2)
strBatchFile = Replace(objFso.GetTempName, ".tmp", ".bat")
strOutputFile = objTempFolder.Path & "\" & objFso.GetTempName
Set objFso = CreateObject("Scripting.FileSystemObject")
' Change the current directory to the installation directory
' This is important, because initdb will drop Administrative
' permissions and may lose access to the current working directory
objShell.CurrentDirectory = strInstallDir
' Is this Vista or above?
Function IsVistaOrNewer()
Set objWMI = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMI.ExecQuery("Select * from Win32_OperatingSystem",,48)
For Each objItem In colItems
strVersion = Left(objItem.Version, 3)
Next
If InStr(strVersion, ".") > 0 Then
majorVersion = CInt(Left(strVersion, InStr(strVersion, ".") - 1))
ElseIf InStr(strVersion, ",") > 0 Then
majorVersion = CInt(Left(strVersion, InStr(strVersion, ",") - 1))
Else
majorVersion = CInt(strVersion)
End If
If majorVersion >= 6.0 Then
IsVistaOrNewer = True
Else
IsVistaOrNewer = False
End If
End Function
' Execute a command
Function DoCmd(strCmd)
Set objBatchFile = objTempFolder.CreateTextFile(strBatchFile, True)
objBatchFile.WriteLine "@ECHO OFF"
objBatchFile.WriteLine strCmd & " > """ & strOutputFile & """ 2>&1"
objBatchFile.WriteLine "EXIT /B %ERRORLEVEL%"
objBatchFile.Close
DoCmd = objShell.Run(objTempFolder.Path & "\" & strBatchFile, 0, True)
If objFso.FileExists(objTempFolder.Path & "\" & strBatchFile) = True Then
objFso.DeleteFile objTempFolder.Path & "\" & strBatchFile, True
End If
If objFso.FileExists(strOutputFile) = True Then
Set objOutputFile = objFso.OpenTextFile(strOutputFile, ForReading)
WScript.Echo objOutputFile.ReadAll
objOutputFile.Close
objFso.DeleteFile strOutputFile, True
End If
End Function
Sub Die(msg)
If objFso.FileExists(strInitdbPass) = True Then
objFso.DeleteFile strInitdbPass, True
End If
WScript.Echo msg
WScript.Quit 1
End Sub
Sub Warn(msg)
WScript.Echo msg
iWarn = 2
End Sub
Function CreateDirectory(DirectoryPath)
If objFso.FolderExists(DirectoryPath) Then Exit Function
Call CreateDirectory(objFso.GetParentFolderName(DirectoryPath))
objFso.CreateFolder(DirectoryPath)
End Function
' Create a password file
strInitdbPass = strInstallDir & "\" & objFso.GetTempName
Set objInitdbPass = objFso.OpenTextFile(strInitdbPass, ForWriting, True)
WScript.Echo Err.description
objInitdbPass.WriteLine(strPassword)
objInitdbPass.Close
' Create the data directory
If objFso.FolderExists(strDataDir) <> True Then
CreateDirectory(strDataDir)
If Err.number <> 0 Then
Die "Failed to create the data directory (" & strDataDir & ")"
End If
End If
'for default xlog dir, don't pass -X parameter
strXLogArg = ""
'Create pg_xlog directory if it is not the default one
If strXlogDir <> strDataDir & "\pg_xlog" Then
strXlogDir = strXlogDir & "\pg_xlog"
strXLogArg = " -X """ & strXlogDir & """ "
If objFso.FolderExists(strXlogDir) <> True Then
CreateDirectory(strXlogDir)
If Err.number <> 0 Then
Die "Failed to create the XLog directory (" & strXlogDir & ")"
End If
End If
End If
Set objNetwork = CreateObject("WScript.Network")
iRetXlog = 0
If IsVistaOrNewer() = True Then
WScript.Echo "Ensuring we can write to the data directory (using icacls):"
iRet = DoCmd("icacls """ & strDataDir & """ /T /grant:r """ & objNetwork.Username & """:F")
WScript.Echo "Ensuring we can write to the xlog directory if it exists (using icacls)"
If objFso.FolderExists(strXlogDir) = True Then
iRetXlog = DoCmd("icacls """ & strXlogDir & """ /T /grant:r """ & objNetwork.Username & """:F")
End If
Else
WScript.Echo "Ensuring we can write to the data directory (using cacls):"
iRet = DoCmd("echo y|cacls """ & strDataDir & """ /E /T /G """ & objNetwork.Username & """:F")
WScript.Echo "Ensuring we can write to the xlog directory if it exists (using cacls):"
If objFso.FolderExists(strXlogDir) = True Then
iRetXlog = DoCmd("echo y|cacls """ & strXlogDir & """ /E /T /G """ & objNetwork.Username & """:F")
End If
End If
if iRet <> 0 Then
WScript.Echo "Failed to ensure the data directory is accessible (" & strDataDir & ")"
End If
if iRetXlog <> 0 Then
WScript.Echo "Failed to ensure the xlog directory is accessible (" & strXlogDir & ")"
End If
' Initialise the database cluster, and set the appropriate permissions/ownership
if strLocale = "DEFAULT" Then
iRet = DoCmd("""" & strInstallDir & "\bin\initdb.exe"" " & strMode & " --pwfile """ & strInitdbPass & """ --encoding=UTF-8 -A md5 -U " & strUsername & " -D """ & strDataDir & """" & strXLogArg & "")
Else
iRet = DoCmd("""" & strInstallDir & "\bin\initdb.exe"" " & strMode &" --pwfile """ & strInitdbPass & """ --locale=""" & strLocale & """ --encoding=UTF-8 -A md5 -U " & strUsername & " -D """ & strDataDir & """" & strXLogArg & "")
End If
if iRet <> 0 Then
Die "Failed to initialise the database cluster with initdb"
End If
' Delete the password file
If objFso.FileExists(strInitdbPass) Then
objFso.DeleteFile strInitdbPass, True
End If
' Edit the config files
' Set the following in postgresql.conf:
' listen_addresses = '*'
' port = $PORT
' log_destination = 'stderr'
' logging_collector = on
Set objConfFile = objFso.OpenTextFile(strDataDir & "\postgresql.conf", ForReading)
strConfig = objConfFile.ReadAll
objConfFile.Close
strConfig = Replace(strConfig, "#listen_addresses = 'localhost'", "listen_addresses = '*'")
strConfig = Replace(strConfig, "#port = 5432", "port = " & lPort)
strConfig = Replace(strConfig, "#port = 5444", "port = " & lPort)
strConfig = Replace(strConfig, "#log_destination = 'stderr'", "log_destination = 'stderr'")
strConfig = Replace(strConfig, "#logging_collector = off", "logging_collector = on")
strConfig = Replace(strConfig, "#log_line_prefix = ''", "log_line_prefix = '%t'")
strConfig = Replace(strConfig, "edb_dynatune = 66", "edb_dynatune = " & strServerUtilization)
strConfig = Replace(strConfig, "#edb_dynatune_profile = oltp", "edb_dynatune_profile = " & strWorkLoadProfile)
Set objConfFile = objFso.OpenTextFile(strDataDir & "\postgresql.conf", ForWriting)
objConfFile.WriteLine strConfig
objConfFile.Close
' Secure the data directory
If IsVistaOrNewer() = True Then
WScript.Echo "Granting service account access to the data directory (using icacls):"
iRet = DoCmd("icacls """ & strDataDir & """ /T /C /grant:r """ & strOSUsername & """:M")
Else
WScript.Echo "Granting service account access to the data directory (using cacls):"
iRet = DoCmd("echo y|cacls """ & strDataDir & """ /E /T /C /G """ & strOSUsername & """:C")
End If
if iRet <> 0 Then
Warn "Failed to grant service account access to the data directory (" & strDataDir & ")"
End If
' Secure the xlog directory
If IsVistaOrNewer() = True Then
WScript.Echo "Granting service account access to the xlog directory (using icacls):"
iRet = DoCmd("icacls """ & strXlogDir & """ /T /C /grant:r """ & strOSUsername & """:M")
Else
WScript.Echo "Granting service account access to the xlog directory (using cacls):"
iRet = DoCmd("echo y|cacls """ & strXlogDir & """ /E /T /C /G """ & strOSUsername & """:C")
End If
if iRet <> 0 Then
Warn "Failed to grant service account access to the xlog directory (" & strDataDir & ")"
End If
WScript.Echo "initcluster.vbs ran to completion"
WScript.Quit iWarn
|
|
#2
|
|||
|
|||
|
bueno al segun parece el usuario lo debe de tomar del instalador.
lo raro es que me crea 2 usuarios en windows. postgres enterprisedb |
|
#3
|
|||
|
|||
|
avance lo mas complejo es el cluster initialization aun no encuentro que toma para inicializarlo.
el instalador creo un batch con nombre aleatorio rad4774c6.bat con el siguiente contenido @ECHO OFF "C:\PostgresPlus\8.4AS\bin\initdb.exe" --pwfile "C:\PostgresPlus\8.4AS\rad43075.tmp" --encoding=UTF-8 -A md5 -U enterprisedb -D "C:\PostgresPlus\8.4AS\data" -X "C:\PostgresPlusData\pg_xlog\pg_xlog" > "C:\Users\gdmx\AppData\Local\Temp\radB9EBB.tmp" 2>&1 EXIT /B %ERRORLEVEL% lo que no se es a que archivos hace referencia. ?? --pwfile "C:\PostgresPlus\8.4AS\rad43075.tmp" "C:\Users\gdmx\AppData\Local\Temp\radB9EBB.tmp" |
|
#4
|
||||
|
||||
|
Y, a todo esto, ¿por qué estás instalando una versión antigua?
// Saludos |
|
#5
|
|||
|
|||
|
JXJ,
De Enterprise DB baja el "One-clik-Installer". Esa instalaion te instala TODO lo que necesitas, no solo PostgreSQL, sino tambien Apache y PHP. Antes de instalar creo que es mejor desinstalar la instalaicion previa. En Windows 7 trabaja muy bien. Yo uso todo el de 32 bits. |
|
#6
|
||||
|
||||
|
El usuario JXJ no ha indicado en ningún momento que esté desarrollando para la web, por lo que ni necesita apache ni php, lo normal en clubdelphi es usar delphi para crear programas de escritorio.
__________________
La otra guía de estilo | Búsquedas avanzadas | Etiquetas para código | Colabora mediante Paypal |
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Como Instalar el F1Book en Windows 7 | arnovisr | Varios | 0 | 23-07-2011 13:50:54 |
| como instalar de slony en windows | uper | PostgreSQL | 1 | 13-03-2010 02:48:59 |
| como instalar delphi.net en windows xp 64bit | kurono | Varios | 0 | 05-08-2008 17:47:24 |
| Como instalar un Tservice (el exe) en Windows Vista | lsg | API de Windows | 1 | 29-06-2008 01:12:48 |
| Como instalar windows Vista | RogerGR | Humor | 8 | 08-03-2007 22:05:50 |
|