centos 環境安裝 及 thrift安裝

2021-08-01 13:41:43 字數 2692 閱讀 9963

一.centos環境安裝及上網配置

2、centos 修改dns

修改對應網絡卡的dns的配置檔案

# vi /etc/resolv.conf 

修改以下內容

nameserver 8.8.8.8 #google網域名稱伺服器

3、centos 修改閘道器 

修改對應網絡卡的閘道器的配置檔案

[root@centos]# vi /etc/sysconfig/network

networking=yes(表示系統是否使用網路,一般設定為yes。如果設為no,則不能使用網路,而且很多系統服務程式將無法啟動)

hostname=centos(設定本機的主機名,這裡設定的主機名要和/etc/hosts中設定的主機名對應)

gateway=192.168.1.1(設定本機連線的閘道器的ip位址。例如,閘道器為10.0.0.2)

4、centos 修改ip位址

修改對應網絡卡的ip位址的配置檔案

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

修改以下內容

device=eth0 #描述網絡卡對應的裝置別名,例如ifcfg-eth0的檔案中它為eth0

bootproto=static #設定網絡卡獲得ip位址的方式,可能的選項為static,dhcp或bootp,分別對應靜態指定的 ip位址,通過dhcp協議獲得的ip位址,通過bootp協議獲得的ip位址

broadcast=192.168.0.255 #對應的子網廣播位址

hwaddr=00:07:e9:05:e8:b4 #對應的網絡卡實體地址

ipaddr=12.168.1.2 #如果設定網絡卡獲得 ip位址的方式為靜態指定,此字段就指定了網絡卡對應的ip位址

ipv6init=no

ipv6_autoconf=no

netmask=255.255.255.0 #網絡卡對應的網路掩碼

network=192.168.1.0 #網絡卡對應的網路位址

onboot=yes #系統啟動時是否設定此網路介面,設定為yes時,系統啟動時啟用此裝置

5、重新啟動網路配置

# service network restart 

或# /etc/init.d/network restart

樓主剛開始只是通過 ifconfig ens33 192.168.xx.xx up

route add default gw 192.168.22.1

nameserver 192.168.xx.xx

設定ip 網管和 dns,結果重啟後就失效了,所以,只能通過以上方法又重新設定。

二.thrift安裝:

3、tar -zxvf thrift-0.9.0.tar.gz

移到預設安裝目錄 

cp -r thrift-0.9.0 /usr/local/   (預設安裝目錄?否則可能影響到生成的thrift bin檔案雖然有生成,但是找不到,安裝在這裡的話可以生成的thrift就在/usr/local/bin裡了,這時終端輸入thrift就有了,否則command not found.當然/usr/local/bin原先應該設定在$path裡)

4、cd /usr/local/thrift-0.9.0

./bootstrap.sh (有you should add the contents of `./aclocal/libtool.m4' to `aclocal.m4'. glibtoolize: you should add the contents of `./aclocal/ltoptions.m4' to `aclocal.m4'. glibtoolize ...關於libtoolize,不管,繼續下面的命令)

5、./configure --with-boost=/usr/include/ 因為boost安裝在/usr/include裡? 

非常重要:可能這裡有乙個關於libtool的錯誤version mismatch error. this is libtool 2.2.4, but the libtool: definition of this lt_init comes from libtool 2.2.6. libtool: you should recreate aclocal.m4 with macros from libtool 2.2.4 libtool: and run autoconf again.

6、make 

7、make install

8、在終端輸入thrift,有下面的東東,ok,install thrift success. 

thrift bin檔案在/usr/local/bin裡 

usage: thrift [options] file 

options: 

-version    print the compiler version 

-o dir      set the output directory for gen-* packages 

(default: current directory) 

-i dir      add a directory to the list of directories 

searched for include directives 

-nowarn     suppress all compiler warnings (bad!)

樓主實際上未進行第一步,且安裝目錄沒有放在/usr/local/下,果然就。。。。。

centos下虛擬環境安裝及備註

最近在做車牌號識別,用anaconda建立的虛擬環境,現在要在django下的web環境部署執行。django 1.10.6 python 3.6 anaconda版本 首先安裝虛擬環境 用mkdir 命令指定虛擬環境安裝路徑 我安裝到了 home python virtualpy webpy3 在...

centos7安裝nodejs執行環境及解除安裝

wget 2.解壓 tar.xz格式檔案需要兩部解壓步驟 1 xz d node v8.11.2 linux x64.tar.xz 2 tar xvf node v8.11.2 linux x64.tar 3.配置環境目錄 ln s usr local node node v8.11.2 linux...

Centos安裝Python虛擬環境及配置方法

virtualenv 可以在系統中建立多個不同並且相互不干擾的虛擬環境。python3的虛擬環境工具配置 1.虛擬環境工具 root localhost opt pipwww.cppcns.com3 install i virtualenv 2.通過命令列建立虛擬環境 root localhost ...