manifoldcf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Wright <daddy...@gmail.com>
Subject Re: ManifoldCF Docker MySQL Connection Error
Date Sat, 24 Nov 2018 17:26:37 GMT
Hi Furkan,

Each database has a superuser name and password, for creating the workarea
and the dbuser that will be active during operation.  So all of these are
needed.

As for why mysql.hostname, mysql.server, and mysql.client are needed --
each database driver has specific needs.  There is no property
"mysql.hostname"; these are the ones used:

>>>>>>
  /** MySQL server property */
  public static final String mysqlServerProperty =
"org.apache.manifoldcf.mysql.server";
  /** Source system name or IP */
  public static final String mysqlClientProperty =
"org.apache.manifoldcf.mysql.client";
  /** MySQL ssl property */
  public static final String mysqlSslProperty =
"org.apache.manifoldcf.mysql.ssl";

<<<<<<

Karl


On Sat, Nov 24, 2018 at 9:58 AM Furkan KAMACI <furkankamaci@gmail.com>
wrote:

> Hi Karl,
>
> I've found why it didn't work. I thought that these are enough:
>
>   <property name="org.apache.manifoldcf.mysql.hostname"
> value="custom_hostname"/>
>   <property name="org.apache.manifoldcf.dbsuperusername" value="root"/>
>   <property name="org.apache.manifoldcf.dbsuperuserpassword"
> value="mypass"/>
>
> However, these key/value pairs are read by ManifoldCF too:
>
>   <property name="org.apache.manifoldcf.database.password"
> value="mypass"/>
>   <property name="org.apache.manifoldcf.database.username" value="root"/>
>   <property name="org.apache.manifoldcf.mysql.server"
> value="custom_hostname"/>
>   <property name="org.apache.manifoldcf.mysql.client"
> value="custom_hostname"/>
>
> So, I've added that properties to make it work. Shouldn't hostname,
> dbsuperusername and dbsuperuserpassword be enough?
>
> Kind Regards,
> Furkan KAMACI
>
>
> On Sat, Nov 24, 2018 at 5:40 PM Karl Wright <daddywri@gmail.com> wrote:
>
>> Hi Furkan,
>>
>> Why do you conclude that MCF is not using the parameters in
>> parameters.xml?
>>
>> It's possible that it cannot *find* parameters.xml.  Have you verified
>> that?
>>
>> Karl
>>
>>
>> On Sat, Nov 24, 2018 at 8:58 AM Furkan KAMACI <furkankamaci@gmail.com>
>> wrote:
>>
>>> Hi Karl,
>>>
>>> When I try to connect a dockerized MySQL from host machine I use ip
>>> address. Symbolic names can be used inter-docker connections with linked
>>> containers.
>>>
>>> I've tried all combinations and none of them worked. I couldn't figure
>>> out the reason why ManifoldCF does not use parameters defined at
>>> properties.xml and why it tries to connect via default username
>>> (manifoldcf) and password (local_pg_passwd).
>>>
>>> Kind Regards,
>>> Furkan KAMACI
>>>
>>> On Sat, Nov 24, 2018 at 3:56 PM Karl Wright <daddywri@gmail.com> wrote:
>>>
>>>> Hi Furkan,
>>>>
>>>> This gives me pause:
>>>>
>>>> <property name="org.apache.manifoldcf.mysql.hostname"
>>>> value="172.17.0.4"/>
>>>>
>>>> A virtualized environment may require use of symbolic names rather than
>>>> hard IP addresses.
>>>>
>>>> Karl
>>>>
>>>>
>>>> On Sat, Nov 24, 2018 at 7:53 AM Furkan KAMACI <furkankamaci@gmail.com>
>>>> wrote:
>>>>
>>>>> Hi Karl,
>>>>>
>>>>> Same config with same MySQL version in non-docker environment works.
I
>>>>> can successfully connect to mysql docker via:
>>>>>
>>>>>     mysql -h 172.17.0.2 -u root -p
>>>>>
>>>>> Here is my config for MySQL:
>>>>>
>>>>>   <property name="org.apache.manifoldcf.database.name"
>>>>> value="amarok"/>
>>>>>   <property name="org.apache.manifoldcf.connectors" value="DEBUG"/>
>>>>>   <property name="org.apache.manifoldcf.databaseimplementationclass"
>>>>> value="org.apache.manifoldcf.core.database.DBInterfaceMySQL"/>
>>>>>   <property name="org.apache.manifoldcf.mysql.hostname"
>>>>> value="172.17.0.4"/>
>>>>>   <property name="org.apache.manifoldcf.mysql.port" value="3306"/>
>>>>>   <property name="org.apache.manifoldcf.dbsuperusername" value="root"/>
>>>>>   <property name="org.apache.manifoldcf.dbsuperuserpassword"
>>>>> value="mypass"/>
>>>>>
>>>>> I've put some logging into ConnectionFactory and this is what I get:
>>>>>
>>>>> ------
>>>>> Database: mysql
>>>>> jdbcDriver: com.mysql.jdbc.Driver
>>>>> jdbcUrl:
>>>>> jdbc:mysql://localhost/mysql?useUnicode=true&characterEncoding=utf8
>>>>> userName: root
>>>>> password: mypass
>>>>> ------
>>>>> ------
>>>>> Database: amarok
>>>>> jdbcDriver: com.mysql.jdbc.Driver
>>>>> jdbcUrl:
>>>>> jdbc:mysql://localhost/amarok?useUnicode=true&characterEncoding=utf8
>>>>> userName: manifoldcf
>>>>> password: local_pg_passwd
>>>>> ------
>>>>>
>>>>> So, it doesn't try to connect a host rather than localhost without
>>>>> respecting properties.xml?
>>>>>
>>>>> Kind Regards,
>>>>> Furkan KAMACI
>>>>>
>>>>> On Sat, Nov 24, 2018 at 3:42 PM Karl Wright <daddywri@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Hi Furkan,
>>>>>>
>>>>>> The only thing that comes to mind is that maybe your MySQL is running
>>>>>> on a different port than you expect, or that the MySQL driver you
are using
>>>>>> is not compatible with your setup.  Basically it is failing to create
a
>>>>>> connection between the driver and the database.
>>>>>>
>>>>>> Karl
>>>>>>
>>>>>>
>>>>>> On Sat, Nov 24, 2018 at 7:28 AM Furkan KAMACI <furkankamaci@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi All,
>>>>>>>
>>>>>>> I try to test ManifoldCF via docker. I've run mysql as follows:
>>>>>>>
>>>>>>> docker run --name custom-mysql -v
>>>>>>> /home/ubuntu/mysql-conf:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=mypass
-d
>>>>>>> mysql:5.7.16
>>>>>>>
>>>>>>> I've run my docker container of ManifoldCF as follows:
>>>>>>>
>>>>>>> docker run --name manifoldcf --link custom-mysql:mysql -p 8345:8345
>>>>>>> -it manifoldcf:2.7.1
>>>>>>>
>>>>>>> However, I get:
>>>>>>>
>>>>>>> *org.apache.manifoldcf.core.interfaces.ManifoldCFException: Error
>>>>>>> getting connection: Communications link failure*
>>>>>>>
>>>>>>> *The last packet sent successfully to the server was 0 milliseconds
>>>>>>> ago. The driver has not received any packets from the server.*
>>>>>>> * at
>>>>>>> org.apache.manifoldcf.core.database.ConnectionFactory.getConnection(ConnectionFactory.java:83)*
>>>>>>> * at
>>>>>>> org.apache.manifoldcf.core.database.Database.executeUncachedQuery(Database.java:797)*
>>>>>>> * at
>>>>>>> org.apache.manifoldcf.core.database.Database$QueryCacheExecutor.create(Database.java:1457)*
>>>>>>> * at
>>>>>>> org.apache.manifoldcf.core.cachemanager.CacheManager.findObjectsAndExecute(CacheManager.java:146)*
>>>>>>> * at
>>>>>>> org.apache.manifoldcf.core.database.Database.executeQuery(Database.java:204)*
>>>>>>> * at
>>>>>>> org.apache.manifoldcf.core.database.DBInterfaceMySQL.performQuery(DBInterfaceMySQL.java:907)*
>>>>>>> * at
>>>>>>> org.apache.manifoldcf.core.database.DBInterfaceMySQL.getTableSchema(DBInterfaceMySQL.java:753)*
>>>>>>> * at
>>>>>>> org.apache.manifoldcf.core.database.BaseTable.getTableSchema(BaseTable.java:185)*
>>>>>>> * at
>>>>>>> org.apache.manifoldcf.agents.agentmanager.AgentManager.install(AgentManager.java:67)*
>>>>>>> * at
>>>>>>> org.apache.manifoldcf.agents.system.ManifoldCF.installTables(ManifoldCF.java:112)*
>>>>>>> * at
>>>>>>> org.apache.manifoldcf.jettyrunner.ManifoldCFJettyRunner.main(ManifoldCFJettyRunner.java:235)*
>>>>>>> *Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
>>>>>>> Communications link failure*
>>>>>>>
>>>>>>>
>>>>>>> I can connect MySQL via command line, I can access it via another
>>>>>>> docker container and I can access it if I create a project which
just
>>>>>>> includes ConnectionFactory.java of ManifoldCF.
>>>>>>>
>>>>>>> What may be the reason for this?
>>>>>>>
>>>>>>> Kind Regards,
>>>>>>> Furkan KAMACI
>>>>>>>
>>>>>>

Mime
View raw message