Some time ago I wrote about serverpools. Today I will show you how you can map servers to serverpools depending on physical attributes like size of memory, CPU count or even self-defined labels. This whole thing is called “server categories”.
Let’s see what attributes we have:
# crsctl status server node-1 -p NAME=node-1 MEMORY_SIZE=32224 CPU_COUNT=8 CPU_CLOCK_RATE=2 CPU_HYPERTHREADING=0 CPU_EQUIVALENCY=1000 DEPLOYMENT=other CONFIGURED_CSS_ROLE=hub RESOURCE_USE_ENABLED=1 SERVER_LABEL= PHYSICAL_HOSTNAME=
Based on that, I can now create categories. I will create two categories because I have 4 servers, 2 of them with 32GB RAM and the other 2 with 64GB RAM. There are several expressions available, the crsctl documentation is quite specific about that.
$ crsctl add category hugeram -attr "EXPRESSION='(MEMORY_SIZE < 32250)'" $ crsctl add category lowram -attr "EXPRESSION='(MEMORY_SIZE > 32250)'" $ crsctl status category NAME=lowram ACL=owner:oracle:rwx,pgrp:oinstall:rwx,other::r-- ACTIVE_CSS_ROLE=hub EXPRESSION=(MEMORY_SIZE < 32250) NAME=ora.hub.category ACL=owner:root:rwx,pgrp:root:r-x,other::r-- ACTIVE_CSS_ROLE=hub EXPRESSION= NAME=ora.leaf.category ACL=owner:root:rwx,pgrp:root:r-x,other::r-- ACTIVE_CSS_ROLE=leaf EXPRESSION= NAME=lowram ACL=owner:oracle:rwx,pgrp:oinstall:rwx,other::r-- ACTIVE_CSS_ROLE=hub EXPRESSION=(MEMORY_SIZE > 32250)
Now I can modify my serverpools based on these categories, assign the servers with lots of RAM to the “gold” serverpool and the ones with less RAM to the “silver” serverpool. My servers will be dynamically (re-)assigned to the propper serverpool, instances get stopped and restarted elsewhere, kind of magic.
$ srvctl modify serverpool -serverpool gold -category "hugeram" $ srvctl modify serverpool -serverpool silver -category "lowram"
In my opinion a very nice method to group services inside one cluster. But there is still more to come in the future. Stay tuned.