Forum Discussion
Use iRules-LX to Blue/Green Deployment
Hello everyone My Irules is below:
when HTTP_REQUEST { if { [HTTP::username] ne "" } { log local0. "User [HTTP::username] has been authorized to access virtual server [virtual name]" Client supplied a valid username, so initialize the iRulesLX extension
set RPC_HANDLE [ILX::init "iruleslx_mysql_plugin" "mysql_extension"] set username [HTTP::username] set rpc_response [ILX::call $RPC_HANDLE myql_nodejs $username $static::mysql_debug]
set rpc_response [ILX::call $RPC_HANDLE myql_nodejs $username]
Send an HTTP 200 response with the groups retrieved from the iRulesLX plugin
HTTP::respond 200 content "\nGroup(s) for '$username' are '$rpc_response'\n"
HTTP::respond 200 content "User Database$rpc_response "
log local0. "Looked up \$username=$username and matched group(s): $rpc_response" } else { HTTP::respond 401 WWW-Authenticate "Basic realm=\"Secured Area\"" } }
But My /var/log/ltm desplay erro log :Jun 21 15:22:12 v13 err tmm[28004]: 01220001:3: TCL error: /Common/iruleslx_mysql_plugin/mysql_irulelx - Could not find ILX extension mysql_extension in path iruleslx_mysql_plugin (line 4) invoked from within "ILX::init "iruleslx_mysql_plugin" "mysql_extension"" How to troubleshotting ?
Thanks
- Jun 21, 2018
First of all, I don't think you need the double qoutes. Just use:
set RPC_HANDLE [ILX::init iruleslx_mysql_plugin mysql_extension]
It seems you are not calling the right extension. What does the following command returns?
tmsh list ilx plugin iruleslx_mysql_plugin
- 235Jun 23, 2018Nimbostratus
Hi Niels van Sluis
Thanks for your reply.My tmsh comamnd output is below:
[root@v13:Active:Standalone] config tmsh list ilx plugin iruleslx_mysql_plugin ilx plugin iruleslx_mysql_plugin { extensions { mysql_extension { } } from-workspace iruleslx_mysql_workspace log-publisher local-db-publisher node-version 6.9.1 staged-directory /var/ilx/workspaces/Common/iruleslx_mysql_workspace }
- Jun 24, 2018
Not sure why it doesn't work in your case. I just setup something similar in my lab running 13.1.0.6 and it just works.
root@(nielsvs-bigip)(cfg-sync Standalone)(Active)(/Common)(tmos) list ilx plugin iruleslx_mysql_plugin ilx plugin iruleslx_mysql_plugin { extensions { mysql_extension { } } from-workspace iruleslx_mysql_workspace log-publisher local-db-publisher node-version 6.9.1 staged-directory /var/ilx/workspaces/Common/iruleslx_mysql_workspace } root@(nielsvs-bigip)(cfg-sync Standalone)(Active)(/Common)(tmos) quit [root@nielsvs-bigip:Active:Standalone] config ls -la /var/ilx/workspaces/Common/iruleslx_mysql_workspace/extensions/mysql_extension/ total 20 drwxrwxr-x. 3 root sdm 4096 2018-06-24 16:35 . drwxrwxr-x. 3 root sdm 4096 2018-06-24 16:35 .. -rw-rw-r--. 1 root sdm 951 2018-06-24 16:38 index.js drwxrwxr-x. 3 root sdm 4096 2018-06-24 16:35 node_modules -rw-rw-rw-. 1 root sdm 381 2018-01-16 17:45 package.json [root@nielsvs-bigip:Active:Standalone] config
Does
shows that the extension is running?tmsh show ilx plugin iruleslx_mysql_plugin
[root@nielsvs-bigip:Active:Standalone] config tmsh show ilx plugin iruleslx_mysql_plugin | grep -B 2 Status | Extension: mysql_extension ------------------------------- | Status running -- | Extension Process: mysql_extension ------------------------------------------ | Status running -- | Extension Process: mysql_extension ------------------------------------------ | Status running [root@nielsvs-bigip:Active:Standalone] config
- 235Jul 01, 2018Nimbostratus
@Niels van Sluis Thanks for you help : )
I've solved the problem. I rewrite my code then don't have display error log.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com