<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:51:38 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[JAVA-162] Unable to connection to a set of slave servers</title>
                <link>https://jira.mongodb.org/browse/JAVA-162</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;If you pass in a list of servers, one must be master.  If you just want to connect to a slave, do &quot;new Mongo(new ServerAddress(ip))&quot;.&lt;/p&gt;


&lt;p&gt;On Tue, Sep 7, 2010 at 10:46 AM, Joseph Wang &amp;lt;josephykwang@yahoo.com&amp;gt; wrote:&lt;/p&gt;


&lt;p&gt;                String[] servers = server_list.split(&quot;,&quot;);&lt;br/&gt;
                ArrayList&amp;lt;ServerAddress&amp;gt; addr = new ArrayList&amp;lt;ServerAddress&amp;gt;();&lt;br/&gt;
                int serverCount = 0;&lt;br/&gt;
                for (int i = 0; i &amp;lt; servers.length; ++i) {&lt;br/&gt;
                    String[] serverInfo = servers&lt;span class=&quot;error&quot;&gt;&amp;#91;i&amp;#93;&lt;/span&gt;.split(&quot;:&quot;);&lt;/p&gt;

&lt;p&gt;                    try {&lt;br/&gt;
                        if (serverInfo.length == SERVER_INFORMATION_FIELD_SIZE) &lt;/p&gt;
{
                            System.out.println(&quot;MongoConnnection: add server &quot;
                                    + serverInfo[SERVER_NAME_FIELD] + &quot; at port &quot;
                                    + serverInfo[SERVER_PORT_FIELD]);
                            ServerAddress host = new ServerAddress(
                                    serverInfo[SERVER_NAME_FIELD],
                                    Integer.parseInt(serverInfo[SERVER_PORT_FIELD]));
                            addr.add(host);

                            serverCount++;
                        }
&lt;p&gt;                    } catch (Exception ex) {&lt;/p&gt;

&lt;p&gt;                    }&lt;br/&gt;
                }&lt;/p&gt;

&lt;p&gt;                if (serverCount &amp;gt; 0) &lt;/p&gt;
{
                    m = new Mongo(addr, opt);
                }

&lt;p&gt;    From: Kristina Chodorow &amp;lt;kristina@10gen.com&amp;gt;&lt;br/&gt;
    To: mongodb-user@googlegroups.com&lt;br/&gt;
    Sent: Tue, September 7, 2010 7:16:19 AM&lt;br/&gt;
    Subject: Re: &lt;span class=&quot;error&quot;&gt;&amp;#91;mongodb-user&amp;#93;&lt;/span&gt; Java Driver Failed to Connect to Slaves&lt;/p&gt;

&lt;p&gt;    What does your code look like?  Are you calling &quot;new Mongo(ip1, ip2)&quot;?  If you&apos;re connecting to a slave, you should just say &quot;new Mongo(ip1)&quot;.&lt;/p&gt;


&lt;p&gt;    On Tue, Sep 7, 2010 at 1:01 AM, Joseph Wang &amp;lt;josephykwang@yahoo.com&amp;gt; wrote:&lt;/p&gt;



&lt;p&gt;        MongoConnnection: add server ip-10-160-86-4 at port 10000&lt;br/&gt;
        MongoConnnection: add server ip-10-161-50-230 at port 10000&lt;br/&gt;
        ...&lt;/p&gt;


&lt;p&gt;        SEVERE: switched to: ip-10-160-86-4:10000 but isn&apos;t master&lt;br/&gt;
        Sep 7, 2010 12:58:04 AM com.mongodb.DBTCPConnector _pickInitial&lt;br/&gt;
        SEVERE: can&apos;t pick initial master, using random one&lt;br/&gt;
        com.mongodb.MongoException: can&apos;t find master&lt;br/&gt;
                at com.mongodb.DBTCPConnector._pickInitial(DBTCPConnector.java:422)&lt;br/&gt;
                at com.mongodb.Mongo.&amp;lt;init&amp;gt;(Mongo.java:177)&lt;/p&gt;</description>
                <environment></environment>
        <key id="13026">JAVA-162</key>
            <summary>Unable to connection to a set of slave servers</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="2">Won&apos;t Fix</resolution>
                                        <assignee username="eliot">Eliot Horowitz</assignee>
                                    <reporter username="josephykwang">Joseph Wang</reporter>
                        <labels>
                    </labels>
                <created>Tue, 7 Sep 2010 15:11:34 +0000</created>
                <updated>Sun, 10 Oct 2010 03:17:58 +0000</updated>
                            <resolved>Sun, 10 Oct 2010 03:17:58 +0000</resolved>
                                                                    <component>Cluster Management</component>
                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="19052" author="eliot" created="Sun, 10 Oct 2010 03:17:58 +0000"  >&lt;p&gt;This doesn&apos;t make sense in the context of replica sets.&lt;br/&gt;
With slaveOk and replica sets you just give all hosts and it&apos;ll route to slaves&lt;/p&gt;</comment>
                            <comment id="18618" author="josephykwang" created="Tue, 28 Sep 2010 02:01:16 +0000"  >&lt;p&gt;Connections to two regular slaves.&lt;/p&gt;</comment>
                            <comment id="18588" author="eliot" created="Mon, 27 Sep 2010 20:35:22 +0000"  >&lt;p&gt;Do you mean a list of regular slaves or in a repclia set?&lt;br/&gt;
A bit confused&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrhcw7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>14889</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>