Thrift Server Linux C + + with client Windows Python environment configuration (thrift with tutorial as an example)

Source: Internet
Author: User

About thrift documentation is really bad. Groped for a long time to finally successfully complete the configuration across Linux and Windows across C + + and Python languages. Here are the steps:

1) environment configuration under Linux

L Complete installation of other packages that thrift depends on: Boost, Libtool, libevent, bison, Flex

    1. Unzip the boost_1_55_0 and enter the BOOST_1_55_0 directory
    2. chmod 777 bootstrap.sh
    3. chmod 777./tools/build/v2/engine/build.sh
    4. ./bootstrap.sh
    5. Go to the libtool-1.3.5 directory
    6. Make
    7. Go to the Libevent-2.0.21-stable directory
    8. Make
    9. Go to the bison-3.0 directory
    10. Make

(not installing these dependent packages will always prompt the failure, but also drunk, I can not rule out what is necessary, therefore all written)

L Thrift Installation

    1. Unzip Thrift compressed file: Tar zxvf thrift-0.9.1.tar.gz
    2. Go to the thrift-0.9.1 directory
    3. ./configure
    4. Make
    5. sudo make install
    6. Thrift–version
    7. Successful display of Thrift version installation succeeded

(Be sure to show the thrift version is not successful install, if not say the previous installation has a problem OH)

L WRITE the. thrift file and generate the intermediate file

L Compile

    1. Thrift–r–gen CPP Tutorial.thritft
    2. Make compilation generates tutorialserver,tutorialclient two executables (we use only the server side)

2) Environment Configuration under window

L Decompression thrift-0.9.1.tar.gz

    1. Installing the Thrift Library

Python setup.py Install

    1. Thrift Generating Code

Use the downloaded good thrift-0.9.1.exe to execute commands in the Thrift-0.9.1\tutorial directory

Thrift-0.9.1.exe–r–gen py Tutorial.thrift

Generate the Gen-py folder in the current folder

3) Run

Linux Service side:

Windows Client :

The final Linux server is shown below

Success,

Thrift Server Linux C + + with client Windows Python environment configuration (thrift with tutorial as an example)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.