Configuring Servers farm (DNS + Active Directory) - configuration

I have my DNS and active directory configured in Server1 (192.163.0.8).
FQDN: abc.domain.com
NetBIOS: abcde
My second Server has Sql Server Installed (both servers are using windows server 2008, but when I try to add Server2(192.163.0.9) to the domain I got the following error message:
an attempt to resolve the dns name of a dc in the domain being joined has failed.
running ipconfig /all in Server2 I got
C:\Users\Administrator>ipconfig /all
Windows IP Configuration
Host Name . . . . . . . . . . . . : Server2
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Intel(R) PRO/1000 MT Desktop Adapter
Physical Address. . . . . . . . . : 99-99-99-99-99-99
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
IPv4 Address. . . . . . . . . . . : 192.163.0.9(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.163.0.1
DNS Servers . . . . . . . . . . . : 192.168.0.8
NetBIOS over Tcpip. . . . . . . . : Enabled
(MORE INFO)
In Server1:
C:\Users\Administrator>ping server1
Pinging SERVER1.abc.domain.com [::1] from ::1 with 32 bytes of data:
Reply from ::1: time<1ms
.....
C:\Users\Administrator>ping abc.domain.com
Pinging abc.domain.com [192.163.0.8] with 32 bytes of data:
Reply from 192.163.0.8: bytes=32 time<1ms TTL=128
....
C:\Users\Administrator>ping server1.abc.domain.com
Pinging SERVER1.abc.domain.com [::1] from ::1 with 32 bytes of data:
Reply from ::1: time<1ms
...
C:\Users\Administrator>ping server2
Pinging SERVER2 [192.163.0.9] with 32 bytes of data:
Reply from 192.163.0.9: bytes=32 time<1ms TTL=128
.....
In Server2
C:\Users\Administrator>ping server2
Pinging SERVER2 [::1] from ::1 with 32 bytes of data:
Reply from ::1: time<1ms
.....
C:\Users\Administrator>ping server1
Pinging SERVER1 [192.163.0.8] with 32 bytes of data:
Reply from 192.163.0.8: bytes=32 time<1ms TTL=128
.....
C:\Users\Administrator>ping abc.domain.com
Ping request could not find host abc.domain.com. Please check the name an
d try again.
C:\Users\Administrator>ping server1.abc.domain.com
Ping request could not find host server1.abc.domain.com. Please check the
name and try again.
Help please! :(

http://social.technet.microsoft.com/Forums/en-US/winservergen/thread/12d31d89-4e4a-4451-bf10-cca38d32e84f

Open Registry Editor (regedit).
2. Navigate to the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\tcpip6\Parameters\
Create the following registry value (DWORD type): DisabledComponents
Set value to 0
Restart your server.
Diwakar

Related

How to connect mysql in docker subnet(172.18) from my local host Windows(192.168)?

my host machine ip is 192.168.8.100
Here are my ipconfig in Windows10
Ethernet adapter Ethernet:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . : DHCP HOST
Ethernet adapter vEthernet (Default Switch):
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::cd90:1c37:f269:c1b5%10
IPv4 Address. . . . . . . . . . . : 172.21.93.241
Subnet Mask . . . . . . . . . . . : 255.255.255.240
Default Gateway . . . . . . . . . :
Ethernet adapter vEthernet (DockerNAT):
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::a80e:8b65:b853:7976%13
IPv4 Address. . . . . . . . . . . : 10.0.75.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
Ethernet adapter VirtualBox Host-Only Network:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::dcad:f104:d3ff:60f%7
IPv4 Address. . . . . . . . . . . : 192.168.56.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
Ethernet adapter Npcap Loopback Adapter:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::f85f:91c6:fcb6:c971%21
Autoconfiguration IPv4 Address. . : 169.254.201.113
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . :
Wireless LAN adapter Local Area Connection* 1:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Wireless LAN adapter Local Area Connection* 2:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Wireless LAN adapter Wi-Fi:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::e58a:9017:15ae:2a26%17
IPv4 Address. . . . . . . . . . . : 192.168.8.100
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.8.1
I create a new subnet from docker
From docker-compose.yml
db:
image: mysql:8.0
container_name: onlinecodedb
volumes:
- onlinecode-database:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: mysqlrootpassword
MYSQL_PASSWORD: mysqlpassword
MYSQL_USER: mysql
MYSQL_DATABASE: onlinecode
ports:
- "3300:3306"
networks:
- onlinecode-net
networks:
onlinecode-net:
driver: bridge
From docker network inspect onlinecode_onlinecode-net
[
{
"Name": "onlinecode_onlinecode-net",
"Id": "b915ecd03a9acdb0d28b8b355dca0a479a186c2b5e6fbb35efb81de1684aa63d",
"Created": "2018-10-02T02:17:36.4110372Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.18.0.0/16",
"Gateway": "172.18.0.1"
}
]
},
"Internal": false,
"Attachable": true,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"0730d1115929f5b476116fd6147782bf15d7f469fb7203779d2d8f5953bdea49": {
"Name": "onlinecodeapp",
"EndpointID": "aa0c0bf03740e500821b1f00d0da2f09d3642723035e0b2e384ac18746bf182a",
"MacAddress": "02:42:ac:12:00:02",
"IPv4Address": "172.18.0.2/16",
"IPv6Address": ""
},
"c3abc13980d415dd0a6494e3e5113847448e004f3b720f1603c826ebbaa2b9db": {
"Name": "onlinecodedb",
"EndpointID": "7e5261e88fcded21e1864906de976ed1c2d5b30d4c94ae65375bf21e0035706c",
"MacAddress": "02:42:ac:12:00:03",
"IPv4Address": "172.18.0.3/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {
"com.docker.compose.network": "onlinecode-net",
"com.docker.compose.project": "onlinecode",
"com.docker.compose.version": "1.22.0"
}
}
]
onlinecodedb in ip B class range but my localhost in C range
So how I connect to mysql from 192.168 to 172.18 ?
I cannot find same question from stackoverflow
I have googled two days, someone said: hey, you should use Gateway and Router.
But How I map 172 to 192? all of them are private IP, not public.
I know this question is stupid, this is a computer network problem, but please help me to solve this problem.
You should try using localhost:3300 to connect to mysql container.
First when your docker engine is installed in your local machine, by default docker is running in localhost (ie) 127.0.0.1 ipaddress.
As per your docker-compose file
ports:
- "3300:3306"
3306 port is exposed inside the container and connects with 3300 port of the host machine.
Next you mentioned about Ipaddress of the container
"Config": [
{
"Subnet": "172.18.0.0/16",
"Gateway": "172.18.0.1"
}
]
This is a network you have created with the name onlinecode-net". This network is created by docker-engine which is used internally to connect between the containers which is not exposed in the host machine.

Perl codes always connecting to same MySQL database although it is configured to connect to different server

Perl codes always connecting to same MySQL(local but in error showing FQDN of server) database although it is configured to connect to different server.
please see the codes.
$datasetname="DBI:mysql:database=applications;host=entdb"
$$dbobject = DBI -> connect ($datasetname, $username, $password,
{RaiseError => 0, PrintError => 0})
or $errflg2 = 1;
print TT (" : ".time()."\n");
close (TT);
if ($errflg2 > 0)
{
$errmsg = "ERROR opening up the database: $datasetname\n";
$errmsg .= " Error number: " . $DBI::err . "\n";
$errmsg .= " Error text : " . $DBI::errstr . "\n";
print "$errmsg";
ilog ($ifile, $errmsg);
mail_it ($errmsg);
if ($debug != 0) { close (DB); }
exit (1);
}
else
{ print "Opened the '" . $datasetname . "' database.\n"; }**
enter code here
error
ERROR opening up the database: DBI:mysql:database=applications;host=entdb
Error number: 1045
Error text : Access denied for user 'entdb'#'vpl121' (using password: YES)
see in code i referred entdb, but Perl connecting to VPL121. Perl codes are running on vpl121.
In mysql all user accounts are identified via username#hostname format, where hostname is the host name or ip address of the computer from which the code connects to the mysql database.
You did write that the perl code runs on vpl121, therefore this is the hostname that mysql uses. Apparently, you do not have any user account that matches the 'entdb'#'vpl121' or the password is incorrect or the given user does not have access to the entdb database.
My guess is that you do not have any matching user accounts. Consider perhaps creating an 'entdb'#'%' user account, where % as hostname stands for any host name or ip address.

Google cloud sql with php

I'm having a problem to connect my DB cloud sql with php.
I've tried every possible way to connect (pdo, mysqli & mysql)
none of them worked.
I've put an IPv4 for the could sql instance and authorized the compute engine IP in the allowed networks section.
When I'm trying to connect from the compute engine with
mysql --host=cloud_sql_IP --user=my_user --password
it's working and I'm able to see the tables.
On the php side I've put this code:
$db = mysql_connect(<CLOUD_SQL_IPV4>, 'root', '');
if (!$db){
die('Connect Error (' . mysql_error());
}
and I get "Connect Error (Permission denied)"
when I'm trying this way:
$conn = mysql_connect(":/cloudsql/<COMPUTE_INSTANCE>:<DB>", "root", "");
if (!$conn) {
die('Connect Error (' . mysql_error());
}
I'm getting:
"Connect Error (No such file or directory"
What else should I do?
Thanks!
Well after diggin into it for 2 days I managed to connect cloud DB
first run this for the permission fix (centos)
setsebool httpd_can_network_connect=1
And for the php it should be written this way:
new mysqli(
<IP_V4>, // host
'root', // username
'', // password
<DB_NAME>, // database name
null,
'/cloudsql/<GCE_INSTANCE>:<DB>'
);

replicate-do-table unable to start slave mysql

I have problems starting slave server when I add replicate-do-table. Current config that works:
server-id=2
master-host=10.100.27.99
master-user=slejv
master-password=<pass>
master-connect-retry=60
replicate-do-db=piksearch
Config that doesn't work:
server-id=2
master-host=10.100.27.99
master-user=slejv
master-password=<pass>
master-connect-retry=60
replicate-do-db=piksearch
replicate-do-table=artikli
replicate-do-table=artikli_polja
replicate-do-table=artikli_posjete8
replicate-do-table=artikli_view
replicate-do-table=kategorije
replicate-do-table=online
replicate-do-table=pitanje_artikal
replicate-do-table=polja
server02:/etc/mysql# /etc/init.d/mysql restart
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
see this link:
replicate-do-db is in contrast to replicate-do-table
you must remove:
replicate-do-db=piksearch
replicate-do-table=artikli
replicate-do-table=artikli_polja
replicate-do-table=artikli_posjete8
replicate-do-table=artikli_view
replicate-do-table=kategorije
replicate-do-table=online
replicate-do-table=pitanje_artikal
replicate-do-table=polja
and write:
replicate-do-table=piksearch.artikli
replicate-do-table=piksearch.artikli_polja
...

Can't connect to local MySQL server through socket

I'm getting the following error on my site when I upload it or submit a page:
mysql_real_escape_string() [function.mysql-real-escape-string]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
What in the world does this mean?
Since the error is being thrown by the call to mysql_real_escape_string() it rather implies that you didn't call mysql_connect() first and pass a valid db handle to mysql_real_escape_string (or the call to mysql_connect() failed).
In some circumstances, the mysql extension will attempt to connect automatically using the default settings in php.ini, failing over to my.cnf if these are not available - which obviously are not valid. Or it may be that the settings are valid but the mysqld is not running.
Have you got scripts which are connecting to the database successfully?
Do you have a username and password for the database?
Try:
check_running();
$user=''; // fill in your details
$password=''; // fill in your details
$hosts=array(
'localhost', '127.0.0.1', $_SERVER['HTTP_HOST'], $_SERVER['SERVER_ADDR']
);
foreach ($hosts as $addr) {
try_con($addr, $user, $password);
try_con($addr . ':3306', $user, $password);
}
function try_con($host, $user, $password)
{
$dbh=mysql_connect($host, $user, $password);
if ($dbh) {
print "Connected OK with $host, $user, $password<br />\n";
} else {
print "Failed with $host, $user, $password<br />\n";
}
}
function check_running()
{
// this assumes that you are using Apache on a Unix/Linux box
$chk=`ps -ef | grep httpd | grep -v grep`;
if ($chk) {
print "Checking for mysqld process: " . `ps -ef | grep mysqld | grep -v grep` . "<br />\n";
} else {
print "Cannot check mysqld process<br />\n";
}
}
Yes exactly, some servers pass the default connection parameters when using mysql functions before connection and throw off an error, some other servers work just fine wherever you place the code
it is always safer to just place mysql_real_escape_string() after establishing mysql_connect() connection