Try some basic connectivity tests.
- Verify that 5022, 5023 and 5024 are listening.
- Verify that the server name you are using is correct.
From the command line :
netstat -an
On my server, you can see that 5022 is listening.
Next make sure that you can connect to those ports via telnet
telnet fully-qualified-server-name 5022
As it mentions in the Note section of the Mirroring Properties GUI, just below the witness field, the server names have to be fully qualified tcp addresses.
You should just see a black screen. In this example I chose a name that would cause a connection failure. If you see "Could not open connection", then the server(s) defined as mirror, principal and witness aren't reachable or you are not using the right name.
The telnet client can be added under Features in Windows 2008.
In Windows 2008, when you right click on Computer, you can see the full computer name.
You should be able to ping it as well from the command line. ex: ping myservername
Update
Please run the following queries on each SQL Server instance and put the results in your question. Many of these troubleshooting tips come from: http://msdn.microsoft.com/en-us/library/ms189127.aspx
Show tcp endpoints
SELECT type_desc, port FROM sys.tcp_endpoints;
Display status of mirroring endpoints
SELECT state_desc FROM sys.database_mirroring_endpoints;
Check that the ROLE is correct
SELECT role FROM sys.database_mirroring_endpoints;
Display permissions to endpoints
SELECT EP.name, SP.STATE,
CONVERT(nvarchar(38), suser_name(SP.grantor_principal_id))
AS GRANTOR,
SP.TYPE AS PERMISSION,
CONVERT(nvarchar(46),suser_name(SP.grantee_principal_id))
AS GRANTEE
FROM sys.server_permissions SP , sys.endpoints EP
WHERE SP.major_id = EP.endpoint_id
ORDER BY Permission,grantor, grantee;
GO
The login for the service account from the other server instance requires CONNECT permission. Make sure that the login from the other server has CONNECT permission. To determine who has CONNECT permission for an endpoint, on each server instance use the following Transact-SQL statement.
Example output:
name STATE GRANTOR PERMISSION GRANTEE
TSQL Local Machine G sqladmin CO public
TSQL Named Pipes G sqladmin CO public
TSQL Default TCP G sqladmin CO public
TSQL Default VIA G sqladmin CO public
Mirroring G SERVERNAME\Grantor CO SERVERNAME\Grantee
Grantor is the account that assigned (CO) connect permission, Grantee is the account that has connect permission
From the command line run ipconfig /all
and note what Host Name returns.
So I want to know can we perform mirroring with different SQL Server instances? Or we can only do it with instances on same server?
Yes of course you can do it. Perhaps it is best idea or a suggested good practice to keep Principal mirror and witness on different servers. Of course Principal and mirror would be different servers.Have a look at article Prerequisites, Restrictions, and Recommendations for Database Mirroring and Things to consider before database setting database mirroring
Also in mirroring how many instance we can configure as a Mirroring server ?
Question is little incorrect or not properly formed. For one principal you can have only one mirror server. Its is not like Logshipping where you can have multiple standby servers for one primary server.
And is it a right way to achieve database availability? Or is there any other/advance way to achieve database availability and security?
To answer this question to absolute correctness one would require to know your environment RPO and RTO. A simple SQL server cluster with mirroring can work good. You can even go storage replication, SRDF various technologies for Hardware redundancy. Database mirroring almost provides a high availability for SQL Server database. If you want OS redundancy as well create SQL Server cluster and then move databases to cluster and then create database mirroring for the desired database.
PS: In whole question you did not provided what error you got while configuring mirroring. Nonetheless if you read the articles I gave you would be able to configure it correctly
Best Answer
You can install from the same media on another server without violating licensing; as long as the mirror secondary has equal or less processors than the primary. As long as you don't use it for active read-only connections, it doesn't need a paid license. See page 11[pdf], this is for SQL 2012, but there have been similar provisions as far back as I can remember.