I have this error when I set up Directory Replica to Answer Queries:
zmlocalconfig -e ldap_url="ldap://ldap2.swarm.free.ci:389 ldap://ldap1.swarm.free.ci:389"
Failed.
Failed to start slapd. Attempting debug start to determine error.
65e97ef7 daemon: bind(7) failed errno=99 (Cannot assign requested address)
65e97ef7 slap_open_listener: failed on ldap://ldap2.swarm.free.ci:389
help me
The error message indicates that the slapd (OpenLDAP server) failed to start because it encountered an issue binding to the specified LDAP URL. The specific error "errno=99 (Cannot assign requested address)" suggests that the address or port specified in the LDAP URL is not available or valid.
Here are some steps you can take to troubleshoot and resolve the issue:
1. Check LDAP URLs: Ensure that the LDAP URLs specified in the ldap_url parameter are correct and accessible. Verify that the hostnames (ldap2.swarm.free.ci and ldap1.swarm.free.ci) resolve to the correct IP addresses and that the LDAP service is running on port 389 on those hosts.
2. Verify Network Configuration: Confirm that the LDAP server is reachable from the server where you're running slapd. Check for any network issues, firewalls, or routing rules that may be preventing connections to the LDAP server.
3. Check LDAP Service Status: Verify that the LDAP service (slapd) is running and listening on port 389 on both ldap2.swarm.free.ci and ldap1.swarm.free.ci. You can use tools like netstat or lsof to check for open ports and listening services.
4. Check for Port Availability: Ensure that there are no conflicts with other services or processes already using port 389 on the LDAP server(s). If necessary, you can try using a different port for LDAP communication or investigate and resolve any conflicts with existing services.
5. Debug Mode: As you've already attempted, consider starting slapd in debug mode to get more detailed information about the error. This can help pinpoint the exact cause of the binding failure and guide further troubleshooting steps.
6. Review Logs: Check the system logs (e.g., syslog or LDAP server logs) for any additional error messages or clues about what might be causing the binding failure. This can provide valuable information for diagnosing and resolving the issue.
7. Permissions and Configuration: Ensure that the user running slapd has appropriate permissions to bind to the LDAP URL and access the necessary resources. Review the slapd configuration file (typically located in /etc/openldap/slapd.conf or /etc/ldap/slapd.d/) to verify that it's correctly configured.
By systematically checking these aspects and addressing any issues you encounter, you should be able to resolve the problem and successfully start the slapd service with the specified LDAP replication configuration.
Jul 03 17:25:40 systemd[1]: Started Carbonio Prometheus OpenLDAP exporter.
Jul 03 17:25:40 mail.epau.edu.dz carbonio-prometheus-openldap-exporter[31429]: time="2024-07-03T17:25:40Z" level=info msg="service starting"
Jul 03 17:25:40 mail.epau.edu.dz carbonio-prometheus-openldap-exporter[31429]: time="2024-07-03T17:25:40Z" level=info msg="starting http listener" addr=":9330" component=server
Jul 03 17:25:40 mail.epau.edu.dz carbonio-prometheus-openldap-exporter[31429]: time="2024-07-03T17:25:40Z" level=info msg="starting monitor loop" addr="ldap://localhost:389" component=scraper security=None
Jul 03 17:25:40 mail.epau.edu.dz carbonio-prometheus-openldap-exporter[31429]: time="2024-07-03T17:25:40Z" level=info msg="Listening on" address="[::]:9330" component=server
Jul 03 17:25:40 mail.epau.edu.dz carbonio-prometheus-openldap-exporter[31429]: time="2024-07-03T17:25:40Z" level=info msg="TLS is disabled." address="[::]:9330" component=server http2=false
Jul 03 17:26:10 mail.epau.edu.dz carbonio-prometheus-openldap-exporter[31429]: time="2024-07-03T17:26:10Z" level=error msg="dial failed" component=scraper error="LDAP Result Code 200 \"Network Error\": dial tcp [::1]:389: connect: connection refused"
Jul 03 17:26:40 mail.epau.edu.dz carbonio-prometheus-openldap-exporter[31429]: time="2024-07-03T17:26:40Z" level=error msg="dial failed" component=scraper error="LDAP Result Code 200 \"Network Error\": dial tcp [::1]:389: connect: connection refused"
Jul 03 17:27:10 mail.epau.edu.dz carbonio-prometheus-openldap-exporter[31429]: time="2024-07-03T17:27:10Z" level=error msg="dial failed" component=scraper error="LDAP Result Code 200 \"Network Error\": dial tcp [::1]:389: connect: connection refused"
Jul 03 17:27:40 mail.epau.edu.dz carbonio-prometheus-openldap-exporter[31429]: time="2024-07-03T17:27:40Z" level=error msg="dial failed" component=scraper error="LDAP Result Code 200 \"Network Error\": dial tcp [::1]:389: connect: connection refused"
Jul 03 17:28:10 mail.epau.edu.dz carbonio-prometheus-openldap-exporter[31429]: time="2024-07-03T17:28:10Z" level=error msg="dial failed" component=scraper error="LDAP Result Code 200 \"Network Error\": dial tcp [::1]:389: connect: connection refused"
Jul 03 17:28:40 mail.epau.edu.dz carbonio-prometheus-openldap-exporter[31429]: time="2024-07-03T17:28:40Z" level=error msg="dial failed" component=scraper error="LDAP Result Code 200 \"Network Error\": dial tcp [::1]:389: connect: connection refused"
Jul 03 17:29:10 mail.epau.edu.dz carbonio-prometheus-openldap-exporter[31429]: time="2024-07-03T17:29:10Z" level=error msg="dial failed" component=scraper error="LDAP Result Code 200 \"Network Error\": dial tcp [::1]:389: connect: connection refused"