(PECL mongo >=1.3.0)
MongoClient::getHosts — �������й���������״̬��Ϣ
This extension that defines this method is deprecated. Instead, the MongoDB extension should be used. Alternatives to this method include:
�˷����������ӵ�������ʱ���á� �������˼�Ⱥ������������״̬�����û�и���������ֻ����һ��Ԫ�ص����飬�����㵱ǰ���ӵ�������
�μ��ֲ�����ѯһ�����ڷֲ�ʽ��ѯ���ݽڵ����Ϣ��
�˺���û�в�����
���ؼ�Ⱥ����������Ϣ���顣 ������ÿ�������������������Ľ����̶ȣ�1 �Ǻܽ�����������״̬��1 �ǻ�Ծ�ڵ㣬2 �DZ��ýڵ㣬0 ����������ping �����������ʱ�䣬�Լ����һ�� ping ��ʱ�䡣 ���磬�ھ���������Ա�ļ�Ⱥ�У�������ȥ�����������ģ�
array(3) {
["A:27017"]=>
array(4) {
["host"]=>
"A"
["port"]=>
27017
["health"]=>
int(1)
["state"]=>
int(2)
["ping"]=>
int(369)
["lastPing"]=>
int(1309470644)
}
["B:27017"]=>
array(4) {
["host"]=>
"B"
["port"]=>
27017
["health"]=>
int(1)
["state"]=>
int(1)
["ping"]=>
int(139)
["lastPing"]=>
int(1309470644)
}
["C:27017"]=>
array(4) {
["host"]=>
"C"
["port"]=>
27017
["health"]=>
int(1)
["state"]=>
int(2)
["ping"]=>
int(1012)
["lastPing"]=>
int(1309470644)
}
}
| �汾 | ˵�� |
|---|---|
| 1.2.10 |
�ԷǼ�Ⱥ��֧�֡� ���ص�����Ԫ������Ҳ������ hostname �� port�� |