Merge branch 'master' into dist/eole/2.6.2/master

This commit is contained in:
Philippe Caseiro 2018-04-12 10:51:18 +02:00
commit 0dfdb70080
3 changed files with 29 additions and 9 deletions

View File

@ -6,8 +6,8 @@ def getMemoryPercentage(percent):
percent = int(percent) percent = int(percent)
totalMemory = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') totalMemory = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
memoryToUse = (totalMemory*percent)/100 memoryToUse = (totalMemory*percent)/100
memoryMb = memoryToUse/(1024.**2) memoryMb = int(memoryToUse/(1024.**2))
return "{0}M".format(int(memoryMb)) return "{0}M".format(memoryMb)
except: except:
return "Error during memory percentage calculation" return "Error during memory percentage calculation"

View File

@ -2,6 +2,7 @@
<files> <files>
<file filelist='dbCluster' name='/etc/mysql/conf.d/galera.cnf' rm='True' mkdir='True'/> <file filelist='dbCluster' name='/etc/mysql/conf.d/galera.cnf' rm='True' mkdir='True'/>
<file filelist='dbTunning' name='/etc/mysql/conf.d/tunning.cnf' rm='True' mkdir='True'/> <file filelist='dbTunning' name='/etc/mysql/conf.d/tunning.cnf' rm='True' mkdir='True'/>
<service servicelist='bdd'>mariadb</service>
<service_access service='mariadb'> <service_access service='mariadb'>
<port service_accesslist='mariadb' protocol='tcp'>3306</port> <port service_accesslist='mariadb' protocol='tcp'>3306</port>
<tcpwrapper service_accesslist='mariadb'>mariadb</tcpwrapper> <tcpwrapper service_accesslist='mariadb'>mariadb</tcpwrapper>
@ -153,6 +154,14 @@
<param name='mismatch'>""</param> <param name='mismatch'>""</param>
</fill> </fill>
<condition name='disabled_if_in' source="dbEnable">
<param>non</param>
<target type='family'>Database Cluster</target>
<target type='family'>Database</target>
<target type='service_accesslist'>dbCluster</target>
<target type='servicelist'>bdd</target>
</condition>
<condition name='disabled_if_in' source="dbCreateFixAdmin"> <condition name='disabled_if_in' source="dbCreateFixAdmin">
<param>non</param> <param>non</param>
<target type='variable'>accName</target> <target type='variable'>accName</target>
@ -167,13 +176,6 @@
<target type='filelist'>dbCluster</target> <target type='filelist'>dbCluster</target>
</condition> </condition>
<condition name='disabled_if_in' source="dbEnable">
<param>non</param>
<target type='family'>Database Cluster</target>
<target type='family'>Database</target>
<target type='service_accesslist'>dbCluster</target>
</condition>
<condition name='disabled_if_in' source="dbCacheQueryEnable"> <condition name='disabled_if_in' source="dbCacheQueryEnable">
<param>non</param> <param>non</param>
<target type='variable'>dbQueryCacheLimit</target> <target type='variable'>dbQueryCacheLimit</target>

18
posttemplate/25-bdd-cluster Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
db=$(CreoleGet dbEnable non)
cluster=$(CreoleGet dbEnableCluster non)
gstateFile="/var/lib/mysql/grastate.dat"
if [[ ${db} == "oui" ]]
then
if [[ ${cluster} == "oui" ]]
then
if [[ ! -e ${gstateFile} ]]
then
galera_new_cluster
fi
fi
fi
exit 0