I want to give my Raspberry PI a static ip address. I only use a network cable. I do not use WLAN.
My "/etc/network/interfaces" is set to static, with address, netmas, network, broadcast and gateway specified. After a reboot the address stays the same. In my router giving it a default address is disabled. I also executed "sudo mv /var/lib/dhcp /var/lib/dhcp1" and rebooted again, still no result. Thank you for your reply.
if you are using Jessie then you need to update the dhcpcd.conf file in /etc/
At the bottom add:
interface eth0
static ip_address=<your ip address>/24
static routers=<your router ip>
static domain_name_servers=<your router ip>
save, exit, reboot
Related
I have a UDOO x86 running Ubuntu 18.04.5 LTS, with Mosquitto v2. This setup has worked as expected until a recent Ubuntu update.
Now, Mosquitto fails to start on boot. In the Mosquitto log file I see that it correctly finds my config file, but then fails with:
Opening ipv4 listen socket on port 1883.
Error: Cannot assign requested address
It then immediately attempts to restart four more times in rapid succession before (apparently) giving up.
Strangely, if I start Mosquitto manually (using sudo systemctl start mosquitto) immediately after boot, the broker starts without error and works properly (both listeners, see below).
My mosquitto.conf:
log_type all
allow_anonymous true
listener 1883 10.11.12.222 # <-- local IP address of my machine
listener 1883 localhost
I've determined that the error is caused by the line with the IP address. If I use only localhost, or if I just use listener 1883 (which I think binds to all adapters?), mosquitto starts and works correctly.
The computer has two network adapters -- an Ethernet adapter statically assigned to 10.11.12.222, and a wireless adapter on a different subnet (using DHCP) connected to the interwebs. I'd like limit my listener to the Ethernet adapter only (and localhost), hence the desire to specify the IP address.
I've tried turning off allow_anonymous and adding a password file -- this doesn't change the behavior.
I'm trying to assign a static ip address to my odoo posbox installed on a raspberry pi. I tried editing the /etc/dhcpcd.conf file by adding
interface eth0
static ip_address=192.168.0.30/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
Also tried editing the /etc/network/interfaces file as so,
auto eth0
iface eth0 inet static
address 192.168.0.30
netmask 255.255.255.0
gateway 192.168.0.1
Both solutions worked, but whenever I reboot my pc the dhcpcd assigns a new ip address. Tried to disable this:
update-rc.d -f dhcpd remove
I am also working in POS Box but I had no problem in dynamic IP although you can refer to the following link. It might be useful because this question is already asked in odoo community.
This is odoo community link where this question has been asked.
Apart from that this link may be helpful to you too.
This link is of github document
There is a lot or problems with dynamic IPs with POSBOX.
You have to edit the IMG, for this follow this steps:
https://stefanoprenna.com/blog/2014/09/22/tutorial-how-to-mount-raw-images-img-images-on-linux/
Afterwards, when you have mounted the IMG, edit the /etc/network/interfaces file
auto eth0
iface eth0 inet static
address 192.168.0.30
netmask 255.255.255.0
gateway 192.168.0.1
Umount the IMG, then burn it as usual, good luck.
I am trying to make a Raspberry Pi processor communicate with my MacBook Pro using a C program. I have an Ethernet cable connected to both devices and a USB wireless adaptor for Wifi connection. Both the Mac and Pi are connected via the same Wifi network.
The C code establishes the Client-Server connection and this code can be found here:
Server: http://www.cs.rpi.edu/~moorthy/Courses/os98/Pgms/server.c
Client: http://www.cs.rpi.edu/~moorthy/Courses/os98/Pgms/client.c
The guide I am using is here: http://www.cs.rpi.edu/~moorthy/Courses/os98/Pgms/socket.html
I placed the server.c file in one of my Mac's folders and the client.c file in a folder within the Raspberry Pi. After compiling both using 'gcc -o client client.c' and likewise server.c, I run the following on the MacBook Pro's Terminal:
./server 51717
Where 51717 is the port number I am using; the server code requires me to specify the port number. The client requires me to pass in my machine's hostname and port number. Therefore, I run the following from the Raspberry Pi's terminal:
./client localhost 51717
When running both ./server and ./client from my MacBook Pro, the program executes just fine. However, the error occurs when executing ./client from the Pi. This yields a: "Connection refused" error. I have tried looking up 'My Hostname' and inputted the value instead of putting 'localhost'. I also placed my IP address over 'localhost' and merely got a 'Connection timed out' error. I am not sure what else to input as my 'hostname' in order to make the connection work.
The issue was in fact that I needed to use the IP Address of the ethernet cable connected to the MacBook Pro. I found that by going to the WiFi button at the top of the screen, clicking 'Open Network Preferences', and then selecting the ethernet tab.
I am trying to port eCos on an i386 PC.
I have downloaded prebuilt redboot.bin from
http://ecos.sourceware.org/ecos/boards/redbootbins/x86pc/
I boot it onto usb disk, using
dd conv=sync if/redboot.bin of=/dev/sdb1
After booting target from usb, I get "IA2!" string on the target monitor always, and on serial port on 38400 8n1 configurations, I receive nothing.
I tried using i386-elf-gdb, but it is not able to connect to the target and starts printing "Ignoring error packet, Continuing..."
I also tried to build redboot using configtool for i386, but it is only able to build library, when I try Tests, It gives ERROR: multiple definition of cyg_start()
I am very new to eCos, and I don't know what I am doing wrong!!.
Ok, I figured out how to boot Redboot on a target i386 pc with RealteK RTL8139 ehternet card.
install grub on usb stick,
mkdir /mnt/USB && mount /dev/sdx1 /mnt/USB
grub-install --force --no-floppy --boot-directory=/mnt/USB/boot /dev/sdx
Build Redboot using ecosconfig, make sure the number of pci bus are less than 8 or more, if more, then need to increase the pci bus range from from 8 inside pci.h, I had my realtek ethernet card on bus 10 dev 10, I had to increase the bus to 11, so that redboot finds realtek card on bootup.
ecosconfig new pc redboot
configtool ecos.ecc
add common ethernet support
Build Library
copy redboot.elf on usb.
on grub startup menu,
insmod multiboot
multiboot /redboot.elf
boot
Thats it, redboot will use BOOTP and provide IP Address, then I can test redboot commands like ip_address, reset, ping, version etc.
I've just installed hadoop and hbase from cloudera (3) but when I try to go to http://localhost:60010 it just sits there continually loading.
I can get to the regionserver fine - http://localhost:60030... Looking at the master hbase server logs I can see the following.
Looks like a problem with the root region.
All of this is installed on a ext4 1TB partition running Ubuntu (Natty) 11. No cluster/other boxes).
Any help would be great!
11/05/15 19:58:27 WARN master.AssignmentManager: Failed assignment of -ROOT-,,0.70236052 to serverName=localhost,60020,1305452402149, load=(requests=0, regions=0, usedHeap=24, maxHeap=995), trying to assign elsewhere instead; retry=0
org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed setting up proxy interface org.apache.hadoop.hbase.ipc.HRegionInterface to /127.0.0.1:60020 after attempts=1
at org.apache.hadoop.hbase.ipc.HBaseRPC.waitForProxy(HBaseRPC.java:355)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getHRegionConnection(HConnectionManager.java:957)
at org.apache.hadoop.hbase.master.ServerManager.getServerConnection(ServerManager.java:606)
at org.apache.hadoop.hbase.master.ServerManager.sendRegionOpen(ServerManager.java:541)
at org.apache.hadoop.hbase.master.AssignmentManager.assign(AssignmentManager.java:901)
at org.apache.hadoop.hbase.master.AssignmentManager.assign(AssignmentManager.java:730)
at org.apache.hadoop.hbase.master.AssignmentManager.assign(AssignmentManager.java:710)
at org.apache.hadoop.hbase.master.AssignmentManager$TimeoutMonitor.chore(AssignmentManager.java:1605)
at org.apache.hadoop.hbase.Chore.run(Chore.java:66)
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567)
at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:408)
at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:328)
at org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:883)
at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:750)
at org.apache.hadoop.hbase.ipc.HBaseRPC$Invoker.invoke(HBaseRPC.java:257)
at $Proxy6.getProtocolVersion(Unknown Source)
at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:419)
at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:393)
at org.apache.hadoop.hbase.ipc.HBaseRPC.getProxy(HBaseRPC.java:444)
at org.apache.hadoop.hbase.ipc.HBaseRPC.waitForProxy(HBaseRPC.java:349)
... 8 more
11/05/15 19:58:27 WARN master.AssignmentManager: Unable to find a viable location to assign region -ROOT-,,0.70236052
Fixed this issue for anyone else who finds this. Was a problem with the host file (/etc/hosts). Need to remove entries relating to 127.0.1.1 COMPNAME - just put a hash (#) in front of this line and then restart all hadoop and hbase services.
More on the solution here: http://blog.nemccarthy.me/?p=110
As per #Manav:
If you find yourself in a situation wherein you can't edit /etc/hosts, the following >workaround will also work:
in conf/hadoop-env.sh add the following line:
export HADOOP_OPTS=-Djava.net.preferIPv4Stack=true
I'm using Ubuntu 11.10 (Oneiric) and HBase 0.92.1. These steps fixed my issue for my single server install:
Edit the /etc/hosts: change the IP address associated with the hostname so that it uses your LAN IP instead of 127.0.0.1
Open <HBASE_DIR>/conf/hbase-env.sh
edit HBASE_OPTS, append -Djava.net.preferIPv4Stack=true. The line should look like this:
export HBASE_OPTS="-XX:+UseConcMarkSweepGC -Djava.net.preferIPv4Stack=true"
Restart HBase
If you find yourself in a situation wherein you can't edit /etc/hosts, the following
workaround will also work:
in conf/hadoop-env.sh add the following line:
export HADOOP_OPTS=-Djava.net.preferIPv4Stack=true
(removed edit, moved as a separate answer)
your hosts file should look like this
#127.0.0.1 localhost
#127.0.1.1 ubuntu.ubuntu-domain ubuntu
192.168.2.100 ubuntu
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
This file can be found in /etc/hosts
Regards
Shuja
The trick with a subinterface worked for me, but i used the loopback interface rather than eth0 because eth0 is not always available on my machine (external adapter) and i want it managed by NetworkManager (which refuses to manage eth0 if eth0.1 is defined in /etc/network/interfaces on ubuntu 13.04)
Relevant snippet:
auto lo:0
iface lo:0 inet static
address 127.0.1.1
netmask 255.255.255.0
in addition to the regular
auto lo
iface lo inet loopback
of course
Here's another work-around that Works For Me, if you're unwilling to alter /etc/hosts (since Ubuntu put that entry there for a reason).
As this post explains, the core problem is that the loopback interface has multiple IPs bound to it while hbase assumes there will be only one. The resulting mismatch causes the master to think a region server has one IP (127.0.0.1), when it's really listening on another (127.0.1.1, the IP bound to the host's declared FQDN.)
Removing the /etc/hosts entry is one way to restore the one-interface-one-IP assumption. Replacing 127.0.1.1 in /etc/hosts with a "real" permanent IP is another. Finally, another is to create a new interface: drop this in the bottom of /etc/network/interfaces:
# Bind an interface solely for the default host FQDN IP, to fix reverse dns
auto eth0.1
iface eth0.1 inet static
pre-up ip link add eth0.1 name eth0.1 type bridge
address 127.0.1.1
netmask 255.255.255.0
You should then be able to sudo ifup eth0.1 and see it in ifconfig. Restart hbase & you should be good to go.
If you happen to already be using eth0.1 the pick another slot (i.e. eth0.2), it shouldn't matter.
EDIT: #bcolyn's use of lo:0 also works for me, and is superior since loopback will always be available. In that case the pre-up line also appears unnecessary.
In your hosts file to change host address from 127.0.1.1 to 127.0.0.1