วันเสาร์ที่ 7 พฤษภาคม พ.ศ. 2554
วันศุกร์ที่ 6 พฤษภาคม พ.ศ. 2554
Bind Multiple IP Addresses to a Single Network Interface Card (NIC)
Bind Multiple IP Addresses to a Single Network Interface Card (NIC) Bind Multiple IP Addresses to a Single Network Interface Card (NIC) Written by Tony Bhimani Requirements This tutorial demonstrates how to bind multiple IP addresses to a single NIC. By using multiple IP's you can run a service under a specific IP while having another service under a different one (for example, have HTTP on one and SMTP on another), or create a private LAN using a local IP and have the alias hold your Internet IP (such as NAT). One of the major benefits is that you don't need a physical adapter for each IP but instead can create many virtual ones tied to a single physical card. The instructions provided apply to RedHat, Fedora, and CentOS. I'll be using LAN IP's in this example, so replace them with the ones you'll be using. The network scripts are located in /etc/sysconfig/network-scripts/. Go into that directory. cd /etc/sysconfig/network-scripts/ The file we're interested in is ifcfg-eth0, the interface for the Ethernet device. If you have a second Ethernet device then there would be an ifcfg-eth1 file and so on for each adapter you have installed. Let's assume we want to bind three additional IP's (192.168.1.111, 192.168.1.112, and 192.168.1.113) to the NIC. We need to create three alias files while ifcfg-eth0 maintains the primary IP address. This is how we'll set up the aliases to bind the IP addresses. Adapter IP Address Type ----------------------------------- eth0 192.168.1.110 Primary eth0:0 192.168.1.111 Alias 1 eth0:1 192.168.1.112 Alias 2 eth0:2 192.168.1.113 Alias 3The :X (where X is the interface number) is appended to the interface file name to create the alias. For each alias you create you assign a number sequentially. For this example we will create aliases for eth0. Make a copy of ifcfg-eth0 for the three aliases. cp ifcfg-eth0 ifcfg-eth0:0 Take a look inside ifcfg-eth0 and review the contents. more ifcfg-eth0 We're interested in only two lines (DEVICE and IPADDR). We'll rename the device in each file to its corresponding interface alias and change the IP's. We'll start with ifcfg-eth0:0. Open ifcfg-eth0:0 in vi and change the two lines so they have the new interface and IP address. vi ifcfg-eth0:0 DEVICE=eth0:0 IPADDR=192.168.1.111Save ifcfg-eth0:0 and edit the other two alias files (ifcfg-eth0:1 and ifcfg-eth0:2) so they have the new interfaces and IP addresses set (follow the table from above). Once you save all your changes you can restart the network for the changes to take effect. service network restart To verify all the aliases are up and running you can run ifconfig (depending on how many new IP's you set up, you can use ifconfig | more to pause the output). ifconfig You can also test the IP's by pinging them from a different machine. If everything is working then there should be a response back. ping 192.168.1.111 Looks like everything is working like a charm. With the new IP's you c |
วันอังคารที่ 19 เมษายน พ.ศ. 2554
oracle 6.0+mysql 5.5 ไปเลย อันนี my.cnf 8 gb for mysql 5.5
##############################
################## Star MySQL-Config #####################
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
default-character-set=tis620
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
server-id = 1
skip-external-locking
skip-federated
big-tables
character-set-server=tis620
key_buffer = 512M
max_allowed_packet = 512M
table_open_cache = 2048
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 128M
thread_cache_size = 8
query_cache_size= 256M
thread_concurrency = 8
low_priority_updates=1
skip-name-resolve
skip-character-set-client-handshake
init_connect = 'SET NAMES tis620'
max_connections = 150
################## InnoDB #######################
innodb_data_home_dir = /var/lib/mysql/
innodb_data_file_path = ibdata1:100M:autoextend
innodb_log_group_home_dir = /var/lib/mysql/
innodb_buffer_pool_size = 4500M
innodb_additional_mem_pool_size = 24M
innodb_log_file_size = 512M
innodb_file_per_table =1
innodb_log_buffer_size = 8M
innodb_log_files_in_group = 2
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 120
innodb_thread_concurrency = 8
innodb_flush_method=O_DIRECT
innodb_checksums=0
innodb_doublewrite=0
innodb_support_xa=0
innodb_max_dirty_pages_pct=90
innodb_open_files = 2048
innodb_locks_unsafe_for_binlog=1
join_buffer_size = 2M
concurrent_insert = 2
max_heap_table_size = 512M
[mysqldump]
quick
max_allowed_packet = 512M
allow-keywords
[mysql]
no-auto-rehash
default-character-set=tis620
[isamchk]
key_buffer = 512M
sort_buffer_size = 512M
read_buffer = 8M
write_buffer = 8M
[myisamchk]
key_buffer = 512M
sort_buffer_size = 512M
read_buffer = 8M
write_buffer = 8M
[mysqlhotcopy]
interactive-timeout
################# End MySQL-Config #################

