Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
227 lines (190 sloc) 7.64 KB
/*******************************************************************************
* Copyright (c) 2012 GigaSpaces Technologies Ltd. All rights reserved
*
* Licensed 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.
*******************************************************************************/
jdbcPort=3306
win64 {
mysqlHome="mysql-5.5.24-winx64"
mysqlD="mysqld.exe"
mysqlProgram="mysql.exe"
mysqladmin="mysqladmin.exe"
mysqldump="mysqldump.exe"
zipName="${mysqlHome}.zip"
/* http://downloads.skysql.com/archive/index/p/mysql/v/5.5.24 */
zipURL="http://downloads.skysql.com/archives/mysql-5.5/${zipName}"
}
linux {
mysqlD="mysqld"
mysqlProgram="mysql"
mysqladmin="mysqladmin"
mysqldump="mysqldump"
}
enableBackup=false
/* backupType is relevant only if enableBackup equals true */
backupType="s3"
/* s3Folder and sc3Gzip are relevant only if
enableBackup equals true and
backupType equals s3 and
apiKey and secretKey and decryptTxt are all set in the global attributes prior to installing this service
(set-attributes command in the CLI) :
set-attributes -scope global '{"apiKey":"YOUR_API_KEY", "secretKey":"YOUR_SECRET_KEY", "decryptTxt":"CHOOSE_DECRYPTION_PHRASE"}'
Invoke list-attributes
(just to see that all is well... )
*/
s3Folder="s3"
sc3Gzip="http://downloads.sourceforge.net/project/s3tools/s3cmd/1.5.0-alpha3/s3cmd-1.5.0-alpha3.tar.gz"
dbName="tamirDB"
dbUser="tamir"
dbPassW="1234"
/*
myCnfReplacements enables user to replace properties in the my.cnf file.
You can use as many propeties as you want.
*/
myCnfReplacements = [
[
"section" : "mysqld",
"variable" : "bind-address" ,
"newValue" : "0.0.0.0"
]
]
/* Set masterSlaveMode to true, if you want the instances to run as master or slave.
If masterSlaveMode is set to false, then all the service instances will run in standalone mode. */
masterSlaveMode=false
/* Use the following format - leave an empty string (startDetectionQuery="") for using the default startDetection ( by port ) :
startDetectionQuery="select count(XXX) as cc from table_name"
*/
startDetectionQuery=""
/*
actionType can be one of the four following: mysqladmin,mysql,mysqldump or import
Examples :
// In this case, dbName is a property which is defined in this properties file
// All the occurrences of MYSQLHOST in actionQuery, will be replaced with the private IP address on which this service instance resides
[
"actionType" : "mysqladmin",
"actionQuery" : "create" ,
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Creating db - Name : ${dbName} ... "
] ,
// In this case, dbUser and dbPassW are properties which are defined in this properties file
// All the occurrences of MYSQLHOST in actionQuery, will be replaced with the private IP address on which this service instance resides
[
"actionType" : "mysql",
"actionQuery" : "\"CREATE USER '${dbUser}'@'localhost' IDENTIFIED BY '${dbPassW}';\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Creating db user ${dbUser} at localhost, passw ${dbPassW} in ${dbName} db... "
],
// In this case:
// dbName,currDBZip,currImportSql are properties which are defined in this properties file
// currDBZip is the local name of the zip file ( after download )
// currImportSql is the name of the sql file which is stored in currDBZip.
// All the occurrences of REPLACE_WITH_DB_NAME in currImportSql, will be replaced with ${dbName}
[
"actionType" : "import",
"importedZip" : "${currDBZip}",
"importedFile" : "${currImportSql}",
"importedFileUrl" : "http://dropbox/1/222/mysql.zip",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Importing to ${dbName} ..."
]
// In this case:
// dbName is a property which is defined in this properties file.
// if actionDbName is an empty string, then --all-databases will be used
// actionArgs contain the flags that you want to use with this mysqldump command
// Do NOT database flags, because they will be set according to the actionDbName.
// So do NOT use the following : --all-databases,-A,--databases, -B
// Do NOT -u flag flags, because it will be set according to the actionUser
[
"actionType" : "mysqldump",
"actionArgs" : "--add-drop-database -c --lock-all-tables -F",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"dumpPrefix" : "myDumpFile_",
"debugMsg" : "Invoking mysqldump ..."
]
*/
postStartActions = [
[
"actionType" : "mysqladmin",
"actionQuery" : "create" ,
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Creating db - Name : ${dbName} ... "
],
[
"actionType" : "mysql",
"actionQuery" : "\"CREATE USER '${dbUser}'@'localhost' IDENTIFIED BY '${dbPassW}';\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Creating db user ${dbUser} at localhost, passw ${dbPassW} in ${dbName} db... "
],
[
"actionType" : "mysql",
"actionQuery" : "\"CREATE USER '${dbUser}'@'MYSQLHOST' IDENTIFIED BY '${dbPassW}';\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Creating db user ${dbUser} at MYSQLHOST, passw ${dbPassW} in ${dbName} db... "
],
[
"actionType" : "mysql",
"actionQuery" : "\"CREATE USER '${dbUser}'@'%' IDENTIFIED BY '${dbPassW}';\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Creating db user ${dbUser} at all hosts, passw ${dbPassW} in ${dbName} db... "
],
[
"actionType" : "mysql",
"actionQuery" : "\"grant usage on *.* to ${dbUser}@localhost identified by '${dbPassW}';\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Granting usage to user ${dbUser} at localhost, passw ${dbPassW} in ${dbName} db..."
],
[
"actionType" : "mysql",
"actionQuery" : "\"grant usage on *.* to ${dbUser}@MYSQLHOST identified by '${dbPassW}';\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Granting usage to user ${dbUser} at MYSQLHOST, passw ${dbPassW} in ${dbName} db..."
],
[
"actionType" : "mysql",
"actionQuery" : "\"grant usage on *.* to ${dbUser}@'%' identified by '${dbPassW}';\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Granting usage to user ${dbUser} at all hosts, passw ${dbPassW} in ${dbName} db..."
],
[
"actionType" : "mysql",
"actionQuery" : "\"grant all privileges on *.* to ${dbUser}@'localhost' with grant option;\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Granting all privileges to user ${dbUser} in ${dbName} db at localhost... "
],
[
"actionType" : "mysql",
"actionQuery" : "\"grant all privileges on *.* to ${dbUser}@'MYSQLHOST' with grant option;\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Granting all privileges to user ${dbUser} in ${dbName} db at MYSQLHOST... "
],
[
"actionType" : "mysql",
"actionQuery" : "\"grant all privileges on *.* to ${dbUser}@'%' with grant option;\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Granting all privileges to user ${dbUser} in ${dbName} db at all hosts ... "
]
]
Something went wrong with that request. Please try again.