When you get an OVF format VM image, you can’t open it with Vmware player directly. lucky there is a way to conver ovf VM image to VMX format.
Download the OVFTool from Vmware.
http://communities.vmware.com/community/vmtn/vsphere/automationtools/ovf
then run the ovftool to convert the image. here is the syntax
Ovftool c:\vm\myvm.ovf c:\vm\vmxvm
Monday, November 22, 2010
VMware player can’t open OVF file
Tuesday, November 16, 2010
How to : Installing and testing Mysql NDB Cluster on Centos Tutorial
AS I mentioned in How to Create a Mysql NDB cluster on a PC, windows 7 tutorial, It requires the same prerequisites to run a simple NDB cluster. I will go over a tutorial to create a one Mgmt node, Two storage Node One Api Node clusters in one single Centos instance.
Download the Linux version of Mysql cluster community edition which is free to use .
Unzip it and copy the folder to /usr/local/mysql, here you may copy to a folder like /usr/local/mysql_xxx where xxx is the edition, then put a link named mysql to that folder.
| scripts, tar -zxvf mysql-cluster-gpl-7.1.8-linux-x86_64-glibc23.tar.gz #unzip itcp -r mysql-cluster-gpl-7.1.8-linux-x86_64-glibc23 /usr/local/ ln -s /usr/local/mysql-cluster-gpl-7.1.8-linux-x86_64-glibc23/ /usr/local/mysql |
Create a user named mysql.
| useradd mysql |
setup the Mysql service.
| cd /usr/local/mysql # you must be in this folder to run the install script./scripts/mysql_install_db once done, copy the demon script cp support-files/mysql.server /etc/init.d/mysql chown -R mysql:mysql /usr/local/mysql/data |
Now you can run service mysql start to startup a regular mysql service.
Time to create a NDB config ini, there are some templates file like config-xxx.ini in the support-files directory, just copy and paste. and change the nodes per you requirement.
I will put a config file in /ndb/config.ini
and put all NDB data into /ndb/folder
| mkdir /ndb |
then change the config.ini just created as the following content.
| [NDBD DEFAULT] [MGM DEFAULT] [NDB_MGMD] [NDBD] |
after saving the chagnes to /ndb/config.init, run a commant ndb_mgmtd –f /ndb/config.ini –-ini to initialize the ndb folder
| cd /usr/local/mysql/bin |
Only mgmt node is active in this cluster now.
run ./ndb twice to start Two NDB Data Nodes.
run the show in ndb_mgm to refersh the status. Two data ndoes are back.
one more step left, change the mysqld API Node to point to ndb cluster ( ask it to pickup the ndb engine and ndb node configuration. all it need is the connectiong to ndb mgm node, node will push all information to API nodes.)
Create one file in /etc/my.cnf as content below.
| [mysqld] |
restart the mysql service. API node is On now
Now you can run several utility to make sure the data is distributed to two NDB data nodes evenly.
| ndb_desc –d hello foo -p |
here two partitions, one has two records, one has one record.
Wednesday, November 10, 2010
How To : installing and testing greenplum single node edition on Centos 5.5
Download the single node edition, Here I use the version 4.0 for redhat /centos , greenplum-db-4.0.0.4-build-1-RHEL5-x86_64.bin
check OS version,
| [root@localhost Desktop]# cat /etc/redhat-release |
if you run the installer on unmatched version of centos, will get an error, “Installer will only install on RedHat/CentOS x86_64”
here run Uname –m, It will tell the hardware spec, 386 or x86_64.
| [root@localhost ~]# uname -m |
run the installer directly.
| [root@localhost Desktop]# ./greenplum-db-4.0.0.4-build-1-RHEL5-x86_64.bin |
read and accept the agreement,
by default the bits will be put into folder /usr/local/greenplum-version. Enter yes to accept the default settings. like folder path, once done. you will get the message like
source /usr/local/greenplum-db-4.0.0.4/greenplum_path.sh
Create a dedicated user to run the process , and folders to hold segments and maser data. given user the folder access permission.
| Here we will create a user named gp Create a maser folder /data/master Create 4 segment folders /data/seg1, /data/seg2,/data/seg3/,/data/seg4 Change ownership folder of /data/* to gp |
Copy one instance from the sample config and change the setting like folder path , listen port.
| cd /usr/local/greenplum-db-4.0.0.4/docs/cli_help |
Switch to user gp, go to home foder, then change two files we just copied here.
| gp_init_singlenode_example content change. MACHINE_LIST_FILE=./single_hostlist_example declare -a DATA_DIRECTORY=(/data/seg1 /data/seg2 /data/seg3 /data/seg4) MASTER_DIRECTORY=/data/master |
Initialize the system. (create folders and start up several postgres processes.)
| [gp@localhost ~]$ gpssh-exkeys -f single_hostlist_example |
once done, when you run ps -aux|grep /data/, you will see 5 postgresq processes here, one master , four segment instances.
Now the single Node cluster is ready, we can use the psql to connect to the instance and have some fun.
| Create one test database CreateDB androidtest psql (8.2.14) androidtestdb=# Create table public.test( id int primary key, state varchar(30) not null); Now we just created one table test which is disturbed by id. which means if we put more data, the data will be distributed and dispatched to different segments by column iD. let’s run a simple sql. insert into public.test values (1,'AL') ,(2,'AK') ,(3,'AS') ,(4,'AZ') ,(5,'AR') ,(6,'CA') ,(7,'CO') ,(8,'CT') ,(9,'DE') ,(10,'DC') ,(11,'FM') ,(12,'FL') ,(13,'GA') ,(14,'GU') ,(15,'HI') ,(16,'ID') ,(17,'IL') ,(18,'IN') ,(19,'IA') ,(20,'KS') ,(21,'KY') ,(22,'LA') ,(23,'ME') ,(24,'MH') ,(25,'MD') ,(26,'MA') ,(27,'MI') ,(28,'MN') ,(29,'MS') ,(30,'MO') ,(31,'MT') ,(32,'NE') ,(33,'NV') ,(34,'nh') ,(35,'NJ') ,(36,'NM') ,(37,'NY') ,(38,'NC') ,(39,'ND') ,(40,'MP') ,(41,'OH') ,(42,'OK') ,(43,'OR') ,(44,'PW') ,(45,'PA') ,(46,'PR') ,(47,'RI') ,(48,'SC') ,(49,'SD') ,(50,'TN') ,(51,'TX') ,(52,'UT') ,(53,'VT') ,(54,'VI') ,(55,'VA') ,(56,'WA') ,(57,'WV') ,(58,'WI') ,(59,'WY') ; How can we tell whether the data are distributed across segments evenly. in each table, there is one system column called gp_segment_id select gp_segment_id, id, state from public.test; gp_segment_id | id | state you can run a basic group query androidtestdb=# select gp_segment_id, count(*) from public.test group by gp_segment_id; also you can run a analyze to tell the execution plan. which will also tell you the segments scan are handled in a parallel way. androidtestdb=# EXPLAIN select * from public.test; EXPLAIN analyze select * from public.test; |
Tuesday, November 9, 2010
Windows: Start or Stop a Service on remote server using wmic
WMIC has been a built-in command since XP as a interface to WMI operations. Here is a basic task , stop or start the windows service on remote server.
Run WMIC on command prompt, or Run box.
By default, the WMIC connect to local WMI service. If you want to connect to a remote Node.
put
| /Node:yourremote Server /User:account enter you password. |
When you run /? , you will be able to see all the built-in Objects that you can interact with.
| Service List, it will show you all services installed on the server |
If you want to list only those service a running, and list the name caption only (like the sql projection syntax. )
| service where state=”running” get name, caption, status |
get a specified service status, like iisadmin
If you want to control the service, like stop the service or restart the service.
to list all the operation on the service ,
Service where name=”iisadmin” call
the same approach applies to the process management.
| process where name=”notepad.exe” call terminate close the notepad.exe process to shutdown the server terminate the winlogon.exe |
Also you can use PSexec to run process on the remote server directly. http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx
Monday, November 8, 2010
yum updates through Microsoft ISA proxy which needs NTLM authentication /NTLM Authorization Proxy Server HTTP Error 407: Proxy Authentication Required
If you have a Centos VM or any other VM that need access internet to update or download some bits. And the Host machine is behind the ISA proxy which is NTLM authentication enabled. Here is the basic Idea to make the guest OS can access the internet without having the Authentication problem.
for some security reason, IT admin might disabled the Basic authentication for ISA access. If you use YUM and have to pass the proxy. Yum only support Basic authentication. so there is the problem. if you put one ISA proxy into /etc/yum.conf like proxy=http://youproxyserver:port and run yum update, you will get 407 error which means authentication failed. even you put the username password into the config. (why? proxy server only accept ntlm authentication)
| login as: root |
answer, install one NTLM Authorization Proxy Server on Host or guest OS. (the APS is python based, run anywhere that has python.) 'NTLM Authorization Proxy Server' (APS) is a proxy software that allows you to authenticate via an MS Proxy Server using the proprietary NTLM protocol. then change the yum.config to use the new proxy server which is anonymous.
more steps,
Download and Install Python
Download and install NTLM Authorization Proxy Server
Change the server.cfg, here is the key change
| PARENT_PROXY:ISA01 User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; MS-RTC LM 8) LM_PART:1 NTLM_FLAGS: 07820000 |
Then startup the proxy utility ntlmaps-0.9.9.0.1\runserver.bat
Now change the yum.conf to the new proxy ISA01, Yum works now.
for Other http client like Wget, you need Export http_proxy=http://yourproxy:port
reference,
http://www.centos.org/docs/5/html/yum/sn-yum-proxy-server.html
Friday, November 5, 2010
CustomBinding binaryMessageEncoding error, Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.
this is an Issue about the WCF Bindings. By default, if you use wshttpbinding or httpbinding, The http channel will use the Text based encoding which is not very efficient in terms of the network transfer. however, you can combine one custombing, just pick up the binaryencoding which is been used by tcpbinding, and httptransfer as the transport channel.
you can create one customBinding like this,
| <customBinding> <binaryMessageEncoding> <httpTransport> </binding> |
if the service is hosted in IIS, and the anonymous access for this folder has been turned off. you may get the follow error when you try to access the svc. even just the wsdl access.
erver Error in '/DemoWCF' Application. Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.NotSupportedException: Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service. Source Error:
Stack Trace: [NotSupportedException: Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.] |
for the fix. just right click the .svc file in IIS and enable the anonymous access.
Tutorial , Firebug , Free Commercial IE httpwatch alternative
HttpWatch is a great Commercial Tool to capture the Http traffic, enable admin to do the user end http analysis. like check the Cache is correct, client did get the Gzip version response. If you are looking for a free alternative. FireBug for fixfox is my top choice. Here is a basic tutorial one Firebug.
Install Firebug on Firefox.
Click tools->add-ons, search firebug. click to install the add-on and restart firefox.
After loaded the firebug, Open Firefox, press F12 or click add-ons to turn it on.
View the Http Request /Response Header. Click the dropdown arrow to enable the traffic capturing.
When you access Wikipedia mainpage, http://en.wikipedia.org/wiki/Main_Page, you will see the resource get requested to web servers. and the timeline.
click one url , i.e the first one. you can tell the server is apache, the wiki used Cache heavily. here the cache could be squid or varnish. the we do get the gzip version response.
scroll down, you can see the request header the firefox is sending out.
If you press Shift and click the refersh in firefox. you will see that the firefox tell the edge server to reload th request and never pickup the cached version.
in the HTML tab, click the pointer to a object like the logo here., you can see the img url and css styles.