thinksns 读写分离配置后报错

WBOY
Release: 2016-06-06 20:47:39
Original
1002 people have browsed it

我们是thinksns上做的二次开发,因为thinkphp可以配置读写分离,所以我在网上找了很多相关文章,都说是如下配置,比如:我的配置(如下)

<code class="lang-php">// 数据库常用配置 - 连接的是本地
    'DB_TYPE'           =>  'mysql',            // 数据库类型
    'DB_DEPLOY_TYPE'    =>  1,
    'DB_RW_SEPARATE'    =>  true,
    'DB_HOST'           =>  '127.0.0.1,192.168.0.220',          // 数据库服务器地址
    'DB_NAME'           =>  'thinksnsv3',           // 数据库名
    'DB_USER'           =>  'root',     // 数据库用户名
    'DB_PWD'            =>  'pwd1,pwd2',        // 数据库密码
</code>
Copy after login
Copy after login

为什么,报错:php_network_getaddresses: getaddrinfo failed: Name or service not known ?
应该是说,主机不认识,可是,我填的都是对的呀,这是为什么呢

回复内容:

我们是thinksns上做的二次开发,因为thinkphp可以配置读写分离,所以我在网上找了很多相关文章,都说是如下配置,比如:我的配置(如下)

<code class="lang-php">// 数据库常用配置 - 连接的是本地
    'DB_TYPE'           =>  'mysql',            // 数据库类型
    'DB_DEPLOY_TYPE'    =>  1,
    'DB_RW_SEPARATE'    =>  true,
    'DB_HOST'           =>  '127.0.0.1,192.168.0.220',          // 数据库服务器地址
    'DB_NAME'           =>  'thinksnsv3',           // 数据库名
    'DB_USER'           =>  'root',     // 数据库用户名
    'DB_PWD'            =>  'pwd1,pwd2',        // 数据库密码
</code>
Copy after login
Copy after login

为什么,报错:php_network_getaddresses: getaddrinfo failed: Name or service not known ?
应该是说,主机不认识,可是,我填的都是对的呀,这是为什么呢

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!